Hello guys,
I am implementing a Kinematic moving platform in my game and got some problems regarding this. I read 2 parameters from a XML file:
Amplitude
Period
So, what I am doing right now is to set its speed as v = (Amplitude / (Period/2)) and then, after (Period/2) seconds, I revert the velocity of the object, so it goes back to its original position. As the values I get for the time step are not always the same (frame rate hiccups) and the sum of time steps not always coincides with one exact Period, my moving platform don't go back to the point it started its movement and it gets a variable Amplitude.
To solve this issue, I was thinking of placing some Sensors to detect where the platform should revert its movement, but bvefore I do that, I would like to know if you guys have any other suggestion.
Thanks
I am implementing a Kinematic moving platform in my game and got some problems regarding this. I read 2 parameters from a XML file:
Amplitude
Period
So, what I am doing right now is to set its speed as v = (Amplitude / (Period/2)) and then, after (Period/2) seconds, I revert the velocity of the object, so it goes back to its original position. As the values I get for the time step are not always the same (frame rate hiccups) and the sum of time steps not always coincides with one exact Period, my moving platform don't go back to the point it started its movement and it gets a variable Amplitude.
To solve this issue, I was thinking of placing some Sensors to detect where the platform should revert its movement, but bvefore I do that, I would like to know if you guys have any other suggestion.
Thanks