On MoveObject so it can rotate it also?
#1

When it's moving I want it to rotate up basically. I scripted a garage door. And I want it to open like one.

If you don't know what I'm talking about here's my visual examples:

The object by default:
http://wescottridgecondos.files.word...arage-door.jpg

Start to move like this:
http://img.archiexpo.com/images_ae/p...ors-153634.jpg

It should finish, pointing out but on a flat side.
Reply
#2

Show current code so ppl can reply
Reply
#3

Uh, I'd try creating a timer which adds a small height difference and rotates it ry and put it on repeat, I'll try whip up a code now but no guarantee
Reply
#4

Quote:
Originally Posted by marinov
Посмотреть сообщение
Show current code so ppl can reply
You obviously don't know what your talking about...
Reply
#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
#6

Quote:
Originally Posted by Zack9764
Посмотреть сообщение
You obviously don't know what your talking about...


Fuck, another fagget like you come here to ask for help and talk to the other like that, fuck off


You obviously didn't even try to make it, thats why u dont have a code to show, learn, and try, last case ask !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)