One for the math heads: orbit around a point
Hello all!
I would like to make my actor orbit around another object, (like a yoyo swinging around your finger.)
I was hoping to have control over the speed and direction too.
I'm really useless at math but assuming there is a formula I can use that would determine it's coordinates from pivot, angle and distance.
Any guidance would be greatly appreciated!
Thanks
Alex
I would like to make my actor orbit around another object, (like a yoyo swinging around your finger.)
I was hoping to have control over the speed and direction too.
I'm really useless at math but assuming there is a formula I can use that would determine it's coordinates from pivot, angle and distance.
Any guidance would be greatly appreciated!
Thanks
Alex
Comments
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
http://dl.dropbox.com/u/5068448/orbit.zip
download that and unzip it.
wherever you drop the orbit actor, that becomes it's center point. By adjusting the local attributes on the actor orbitDistance and orbitSpeed, you can adjust the diameter of the circle, and the speed it travels around
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
I just got home and what a pleasant surprise.
This is fantastic - thanks so much !
I wanna make it so that when you press left arrow the actor revolves left, right to right.. i already set it up, but the problem is that sin and cos are using Time, and that makes the actor jump to another location when you release left (actor stops) then when you press right jumps to another location along the circular path and starts revolving right from there..
any thoughts?
How would I proceed to make multiple actors orbit around the same point, at the same speed, same direction but offset from each other.
I tried spawning them at 1 second intervals but they "stick" together.
I also tried a few things in the math formula but that didn't seem to work.
I'm guessing game.time needs to be changed to a unique value for each actor?
Thanks in advance
Subtracting an amount from game.time offsets the actor.
No I'm never going to get any sleep
okimoki, maybe try replacing game.time with a controlled value..
sorry, I'm still at the very beginning of the gamesalad adventure
Cheers
Alkex
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
in more detail:
create an attribute called customTime. replace game.Time with customTime.
then create two rules
when leftKey pressed
Timer
every .5 seconds
change customTime = customTime+5
when rightKey pressed
Timer
every .5 seconds
change customTime = customTime-5
you'll have to play around with the values to adjust how smooth / fast you want it.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left