playMaker

Author Topic: AddForce issue  (Read 2003 times)

lioncirth

  • Junior Playmaker
  • **
  • Posts: 74
AddForce issue
« on: December 24, 2014, 07:08:46 AM »
Hi

I am working on an element of my game where fireballs shoot from the ground upwards and then despawn after 1 second.

It works fine in that I have them spawn, shoot up and then despawn. Issue I am facing is over time the amount of force seems to decrease, the first fireball shoots up and then gradually it shoots up less - Any idea why since it should be spawning a new version each time...

Thanks

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: AddForce issue
« Reply #1 on: December 30, 2014, 12:23:26 PM »
Are you using a pooling solution? seems so as you say "spawn" and "despawn" instead of create/destroy

If so you have to reset all the physics on the objects- there are some posts about it here that helped me get it working correctly if you searching for pooling

You have to zero out the force and torque- I also set kinematic to on then off before spawning
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

lioncirth

  • Junior Playmaker
  • **
  • Posts: 74
Re: AddForce issue
« Reply #2 on: January 01, 2015, 11:12:52 AM »
Thanks a lot!

Will see if I can find the info :)

Would use create/destroy to save time but not the best way to optimize I suppose lol :)