Applying forces to actor

ramis2kramis2k Member, PRO Posts: 17
edited August 2012 in Working with GS (Mac)
Hey guys

I've this ball-shaped actor reacting to physics and gravity downwards.

I want it to react to other actors on collision. These other actors will change it's direction, like for example my ball will touch an actor that should launch it up, or touch another actor like a bomb and will blow away, etc. But I always want my actor to follow physical rules (if it's rolling left to right I don't want to launch it straight up, but to keep its inertia).

I've found ways (like creating fake transparent actors that would move and hit my main actor to 'launch' him up), but I'm not sure that's a correct, consistent way of applying forces.

What's the correct way to achieve that?

Thank you

Comments

  • wij_manwij_man Member Posts: 66
    If you apply gravity to the scene and give your actor a mass/density then gravity will be applied correctly. As for it moving left and bing pushed up you would need to calculate the angle to send it yourself using something like (hand written @ 01:34, so no promises) vectorToAngle(self.Motion.Linear Velocity.X - explosion.Velocity.X, self.Motion.Linear Velocity.Y - explosion.Velocity.Y)

    Obviously explosion.Velocity.X/Y need to be the force which is being applied to your actor. Here's a great video by TSB (get used to hearing "T Shirt Booth Here" if you're not already!):

    Thanks
  • ramis2kramis2k Member, PRO Posts: 17
    Awesome.
    I was getting weird effects, until I realized I had to check "Relative to Scene", otherwise the rotation of my actor was taken into account.

    Thanks!
Sign In or Register to comment.