Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: deewahyu on August 28, 2014, 10:52:12 PM

Title: Movement distance
Post by: deewahyu on August 28, 2014, 10:52:12 PM
Hi... i want to create a logic to decrease energy of player every specific distance of movement. For example, every 100meter of movement, the energy will decreased by 0,5 % of energy. Which playmaker's action can i use? Thanks
Title: Re: Movement distance
Post by: jess84 on August 29, 2014, 01:59:11 AM
You probably want to calculate the time spent moving, rather than a distance - so it decreases even if the player runs around in a circle.

I would probably use a float add action and detect when my player is moving, and increase the float value. (stopping the float if the player stops moving).

then link the health value to the 'player movement' float.