Rotating 180 degrees from bottom of actor constantly
Mooseface
Member Posts: 13
Hi There,
i have an actor 100 high, 10 wide, and need it to go from facing 180 to facing 0 constantly, rotating from the bottom.
Can anyone guide me in the right direction?
Thanks
Comments
Constrain X to: 50 *cos((90 *sin( game.Time *100))+90)+X position
Constrain Y to: 50 *sin((90 *sin( game.Time *100))+90)+Y position
Constrain Rotation to: 90 *sin(game.Time *100)
thanks socks tht great, it nearly works how i want it.
i need the bottom of the stick to stay in the same place? can you help
Yes, use the code I posted above, it rotates the actor from its base.
i have but it moves round the bottom of the screen, the bottom doesnt stay fixed
Could you take a screenshot of your rules.
socks, you are the man /or woman, thanks very much i had missed a ) out
Socks, you might be able to help with this I have 2 more problems.
I have a setup where for every .1 seconds you hold the up button the height increases of the actor by 5 and the y position also increases by 2.5 to compensate so it gives the illusion it is growing longer. This worked before the rotation but not it grows at top and bottom?
Also I have a actor constrained to the top of the stick, this doesn't stay constrained when it rotates or grows at an angle but does if it grows straight up. Is there a way to fix it even with the rotate?
I don't know what this means, your language is a bit vague. "but not it grows at top" ?
"rotates or grows at an angle" ? Not sure what that means either ? Asking someone to amend some existing code without showing them the code is an exercise in mind reading ! I will answer your question if you answer mine: I have a calculation, it was working fine, but I added it to another calculation and now it doesn't work, is there a way to fix this ?
Let me have another go.
So I am talking about the same actor that has been given the rotate function. 100 high by 10 wide.
I have a rule setup so that every .1 seconds you hold the up button down, it increases the height of the actor by 5. This puts 2.5 to the top and -2,5 to the bottom.
I have set it to also increase the y axis of the actor by 2.5 at the same time. So it only gets longer from the top.
The problem now is, unless the actor is at 90 degrees, it doesn't gove the same effect of only growing from the top. And I can't figure out why.
Like I say, asking someone to amend existing code without showing them the code is an exercise in mind reading, I have no clue how you are doing any of this, so any attempts at fixing it would be a guess.