Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Position Constraints
#1
Hello!

I've been having a blast with the soft body asset and am trying to get used to not working with a rigidbody. I'm only a novice game designer and I hope this is just something easy I cannot figure out.

I'm having a ton of trouble coding a movement script and setting up constraints to make a ball (like in the Ballpool demoscene) a moveable character. I tried using .AddForce in particular directions but because the ball rolled around it's up, right and forward were always changing. I tried to constrain it so it wouldn't roll but found that wasn't easily achieved. I coded a .Clamp onto the Ball that has the SoftBody but it still rolled around while what looked like an Empty Game Object adhered to my code. After some reading I think it's because it's made out of particles and not a continuum material like rigidbodies? Anyways, I'm scratching my head figuring out how to do this and I'm sure I'm over complicating this. 

In short: how do I constrain the x, y or Z of soft bodies and accurately apply force up, forward and right no matter how it has rolled? 

Thank you for any feedback.
Reply
#2
(09-07-2019, 11:54 PM)Watts Wrote: Hello!

I've been having a blast with the soft body asset and am trying to get used to not working with a rigidbody. I'm only a novice game designer and I hope this is just something easy I cannot figure out.

I'm having a ton of trouble coding a movement script and setting up constraints to make a ball (like in the Ballpool demoscene) a moveable character. I tried using .AddForce in particular directions but because the ball rolled around it's up, right and forward were always changing. I tried to constrain it so it wouldn't roll but found that wasn't easily achieved. I coded a .Clamp onto the Ball that has the SoftBody but it still rolled around while what looked like an Empty Game Object adhered to my code. After some reading I think it's because it's made out of particles and not a continuum material like rigidbodies? Anyways, I'm scratching my head figuring out how to do this and I'm sure I'm over complicating this. 

In short: how do I constrain the x, y or Z of soft bodies and accurately apply force up, forward and right no matter how it has rolled? 

Thank you for any feedback.
use the camera as a reference, ie addforce camera forward etc
Reply