On MoveObject so it can rotate it also?
#5

I think this is what Shadow is saying: something like this. Play with the values a little bit until you get it to work for you.

pawn Код:
//Under Command or timer, whatever:
new GarageTimer;
GarageTimer = SetTimerEx("OpenGarage", 300, true, "i", objectid)

forward OpenGarage(objectid);
public OpenGarage(objectid)
{
    new count, Float:gX, Float:gY, Float:gZ, Float:gXr, Float:gYr, Float:gZr;
    if(count <=5) //If this is 5, each addition should be 1/5th of the distance it actually has to move. Example below
    {
         GetObjectPos(objectid, gX, gY, gZ);
         GetObjectZAngle(objectid, gXr, gYr, gZr);
         MoveObject(objectid, gX, gY, gZ+.5, SPEED); //play with speed
         SetObjectRot(objectid, gX+AMT, gY+AMT, gZ+AMT); //Add a fraction of the angle to whatever axis you're rotating it on
    }
    else return KillTimer(GarageTimer);
}
Ok since the loop will run 5 times, subtract the beginning Z position from the end Z position and thats your difference. ie: Starting Z = 200, End z = 205. 205-200 = 5, so on SetObjectPos you would do gZ+1 (5 units divided by 5 times the timer will run). Same basic principle with the angle.
Reply


Messages In This Thread
On MoveObject so it can rotate it also? - by Zack9764 - 26.01.2011, 00:29
Re: On MoveObject so it can rotate it also? - by marinov - 26.01.2011, 00:38
Re: On MoveObject so it can rotate it also? - by Shadow™ - 26.01.2011, 01:26
Re: On MoveObject so it can rotate it also? - by Zack9764 - 26.01.2011, 01:28
Re: On MoveObject so it can rotate it also? - by randomkid88 - 26.01.2011, 02:05
Re: On MoveObject so it can rotate it also? - by marinov - 26.01.2011, 03:01

Forum Jump:


Users browsing this thread: 1 Guest(s)