Determining the speed of an actor

ffcurry

  • Posts: 29

Is there a direct way to determine the speed of an actor?  There seems to be a getter for angle/direction, but I can't find one for total speed (though there is one for x-speed and y-speed).

Do you just need to calculate it from the x/y speeds using the Pythagorean theorem, or is there a better way.  The calculation isn't a big deal, but I am unsure if just figuring out the hypotenuse would translate into the same number that Stencyl/box uses when one uses commands to set direction and speed.



nomnum

  • Posts: 8
Hey! I am pretty new to stencyl myself so i could easily be wrong but if you look at my attatchment picture...

Would this solve your prob?

rob1221

  • *
  • Posts: 9473
@nomnum he's asking for a way to GET velocity, not set velocity.

@ffcurry there isn't a block for that, and I didn't see a way to get velocity in the API documentation either.  You'll have to use trigonometry as you said.  I recommend making a global custom block out of it.

ffcurry

  • Posts: 29
Nom: Yeah, I was trying to get not set, but thanks for the try.

Rob: Okay thanks.




Hey! I am pretty new to stencyl myself so i could easily be wrong but if you look at my attatchment picture...

Would this solve your prob?