Accessing a sprite's current speed

This forum is currently in read-only mode.
From the Asset Store
Have you ever dreamed of playing in a Speedball game or tournament?
  • I want to set an object to a different animation depending on how fast it is currently going. I can't seem to find any way to access this data though, even though it clearly must have it as a variable somewhere, since I can set max speeds. Is there any way for an event to include a condition based on a sprite's speed, or other variable not in the list of things I can select in the wizard?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • What behavior are you using? Although in all of the behaviors that involve user movement there's a tab for the behavior when retrieving expressions. The expression for retrieving a platform objects X speed, for instance, would be:


    Of course, you'd change "Sprite" to whatever your object is called, but that's about it. I hope I explained all that well enough.

  • I'm using the Platform behavior.

    I guess what I don't understand is how to add an event that isn't in the wizard. So I'd want to have an event where the condition is "Player[Platform].VectorX Greater than 300", but I can't seem to figure out how to put it in.

  • You can do it with the System object. There's a general "Compare" condition that lets you access the expressions for objects if there isn't a built-in condition for them.

  • Thank you!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)