playMaker

Author Topic: Movement distance  (Read 1496 times)

deewahyu

  • Playmaker Newbie
  • *
  • Posts: 10
Movement distance
« 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

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Movement distance
« Reply #1 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.