Gravity and rotation
Forcing
Member Posts: 93
Hello Community,
Can someone help me please, my problem is i use gravity on my game, i made actors, who aren´t moveable, because, when it isnt moveable, it´s don´t using physics!
But i want to make my actor rotating, when i click to it, but the actor isn´t moveable, so i can´t use rotation!
And when i click to moveable, so its using physics, but i don´t want it on this actor, how can i solve it??
(I´am complicated, i know ^^)
Can someone help me please, my problem is i use gravity on my game, i made actors, who aren´t moveable, because, when it isnt moveable, it´s don´t using physics!
But i want to make my actor rotating, when i click to it, but the actor isn´t moveable, so i can´t use rotation!
And when i click to moveable, so its using physics, but i don´t want it on this actor, how can i solve it??
(I´am complicated, i know ^^)
Comments
create a self bolean attribute called rotate
Then create rule
When touch is Pressed
Change attribiute self.rotate to true
Otherwise
Change attribute self.rotate to fales
Then a second rule when self.rotate is true
interpolate self.rotation to self.rotation+10 for a duration of 0.1
This should give you a small change in rotation each time you touch
If you wanted to do a constant rotation once touch instead of interpolate you should be able to do
constrain self.rotation to self.rotation+1
but be sure to take the otherwise out of the first rule or it will stop when you lift up .
Good Luck
You two saved my day ^^