How to make object moving step by step?
#1

Hi i want to know how to make object moving step by step?
For ex. - object moving, then he making little step, then he turning to other side... (i hope you understood). But i want to move objects with only one command, for ex. /moveobject...
Reply
#2

What type of object you want to move?
Reply
#3

I'm not sure if what you mean is what im going to say but anyway.

You can create a variable that will store the "step" of the object.
Then you can use OnObjectMoved having a "switch" in it for each step and moving it to the next location.

Example:
pawn Код:
new ObjectStep = 1;

//OnGameModeInit
Create your object and then move it to the 1st location

public OnObjectMoved(objectid)
{
    if(objectid == YOUR_OBJECT)
    {
        switch(ObjectStep)
        {
                case 0: //Move Object to the 1st location
                case 1: //Move Object to the 2nd location
                case 2: //Move Object to the 3rd location
        }
        ObjectStep ++;
        if(ObjectStep > YOUR_LAST_STEP) ObjectStep = 0;
    }
    return 1;
}
Reply
#4

You must use SetTimer:

If the player write /moveobject, we move to the step 1 the object. We launch a timer and after this timer, the object move to step 2 and you lauch a timer and after this timer, the object move to the step 3. Do you understand?
Reply
#5

Quote:
Originally Posted by mehdi-jumper
Посмотреть сообщение
You must use SetTimer:
Why "must" use a timer when its possible and easier without it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)