Right frame rate or applyImpulse?
by Vincenzo Selvaggio · in Torque Game Engine · 12/13/2006 (6:38 am) · 1 replies
Hi All,
I have an item that has a relative position, and it depends of the player position.
If I use a schedule function that each 100millisec set the position of the item to the new position I have a "bad" motion effect (item duplication).
Choosing the right schedule time (the same of the frame rate) do you think should be fine?
I was also thinking to another solution:
because I know the current item position (let's say posA) and I know the destination position (posB) how can I apply an impulse to the item from posA to posB.
Thank you
Vincenzo
I have an item that has a relative position, and it depends of the player position.
If I use a schedule function that each 100millisec set the position of the item to the new position I have a "bad" motion effect (item duplication).
Choosing the right schedule time (the same of the frame rate) do you think should be fine?
I was also thinking to another solution:
because I know the current item position (let's say posA) and I know the destination position (posB) how can I apply an impulse to the item from posA to posB.
Thank you
Vincenzo
About the author
Torque Owner Joshua Jewell
Apply impulse can best be described as applying a force onto the item. If the item is not effected by gravity (One of the floating crossbows) then applying an impulse would have no effect. In the case where the item is affected by gravity then it would be much more complicated to figure out exactly how much impulse you need to apply.
I think using apply impulse would be much more trouble then it is worth. Setting the position is probably the best bet if you want to do it in script. In order for it to look smooth you can match the frame rate or move the object faster then the frame rate.