Constant Object Rotation - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Constant Object Rotation (
/showthread.php?tid=609341)
Constant Object Rotation -
SsHady - 11.06.2016
Hello Everyone,
I'm planning on making an object that rotates abouts its axis constantly for ever, I need this object to finish my parkour map. It will be a circle or square object(any) and I want it to rotate about its axis in a slow and constant speed forever. Any kind of help will be highly appreciated.
Thanks,
~SShady.
Re: Constant Object Rotation -
AliDollar - 11.06.2016
try this Include
https://sampforum.blast.hk/showthread.php?tid=151452
Re: Constant Object Rotation -
SsHady - 11.06.2016
Quote:
Originally Posted by AliDollar
|
I wasn't born yesterday, thanks for trying though. I want it without includes please. There are some functions that do it but unfortunately I cannot find any good documentation on it.
Re: Constant Object Rotation -
PrO.GameR - 11.06.2016
You do realize giving you an include that does it is same as copy pasting a function that does it right?
you probably don't

here is a tip, move object rotates objects smoothly if you include some little movement in it too, if you want something to happen over and over again, timers.
there you go, you can build it yourself with those 2 tips in mind..
Re: Constant Object Rotation -
NaS - 11.06.2016
You have to move the object that should rotate (0.001 is enough). You can move it up (and also specify rotations) and then down again, and so on. The speed can be calculated from the distance it moves (m/s) - if the speed is the same as the distance, it takes 1 second to complete.
Use the callback OnObjectMoved for it to be smooth and this way you dont even need a timer. Use a variable to identify the position it's at (the state basically) to decide if it should move up or down.
You could've taken a look at the include above too - you don't have to use it, you can read it and figure out what to do. There's also a script in the samp server package that shows steady object rotations.