Move to, higher speed code?

I have self pos x and x. I need a code that depending on the distance between the 2 x's the move to speed becomes greater or less. I dont know how to use magnitude but i tried with ((self x-x)^2)*100, cause move to needs a pos velocity but it dont work either.
I need the code in my level select, the more distance there is between the levels the player shouldnt need to sit and wait cause camera only moves at 300.
Please help :)

Comments

  • hamarohamaro Member Posts: 31
    Bump, was it understandable or should i try to describe it in another way?:)
  • ShaunEleryShaunElery Member, PRO Posts: 148
    What if you tied the camera to a dummy actor and used accelerate instead of move?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Constrain Attribute game.speed to 100*abs(self.positionX-game.X)/game.MaxPossibleDistanceBetweenTheTwo

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • hamarohamaro Member Posts: 31
    Thank you tatiang, it looks beautifull!
  • ImpactBlueStudiosImpactBlueStudios Member Posts: 53
    Judging from the number of views on this thread, people (like me) must've thought this was lua free related :P
Sign In or Register to comment.