Player - Follow Path / Predefined Movement?
by Rachel P · in Torque Game Builder · 12/19/2011 (12:27 pm) · 1 replies
Hi all!
What I'd like to do is either have the player's sprite follow a particular path (predefined automatic movement) upon a) the pressing of a button and b) collision with the path.
I've done some research and I see that apparently you need to change the player to an AIPlayer in order to get it to follow a path. Can someone give me more details - for example, how do I make the "player" an "AIPlayer"? And then what is the script to make the AiPlayer follow the path? (and when I say follow the path, I simply mean follow the movement of the path from wherever the player currently is - not to have the player jump to the particular path and move along it). Is there perhaps another way to go about doing this? For example, say I want the player to move in a zigzag pattern upon pressing the "a" key.
If someone could just help me get started, that'd be great and I'm sure I could figure the rest out as I go. :)
Thanks a lot everyone!
Rachel
What I'd like to do is either have the player's sprite follow a particular path (predefined automatic movement) upon a) the pressing of a button and b) collision with the path.
I've done some research and I see that apparently you need to change the player to an AIPlayer in order to get it to follow a path. Can someone give me more details - for example, how do I make the "player" an "AIPlayer"? And then what is the script to make the AiPlayer follow the path? (and when I say follow the path, I simply mean follow the movement of the path from wherever the player currently is - not to have the player jump to the particular path and move along it). Is there perhaps another way to go about doing this? For example, say I want the player to move in a zigzag pattern upon pressing the "a" key.
If someone could just help me get started, that'd be great and I'm sure I could figure the rest out as I go. :)
Thanks a lot everyone!
Rachel
About the author
Vlad I
Default Studio Name
I'm not too sure but when you say Player or AIPlayer , these should be functions in your .cs
What I would do is to make your object mount to a path (attachObject). You script onMousedown or onCollision with your path.
Mind you I'm in no way a pro, just a learner.