Is it possible to limit the scene.Camera.Rotation?
Hi. I'm trying to make a game where the scene rotates. To accomplish that I'm using a "Change Atribute" for "scene.Camera.Rotation". When I press Left or Right the scene rotates, but I want the action to stop at 45º or -45º.
I've tried a few things but they haven't worked
Is there any way to do this? Thanks in advance.
Best Answers
-
marc_greiff Posts: 250
a few options might work:
1) use the "rotate to angle" attribute
2) use the "interpolate" attribtue
3 constrain scene.Camera.Rotation=scene.Camera.Rotation+1
4) set up a loop condition with a change attribute inside.
Loop condition:
loop unitl scene.Camera.Rotation = 45 (or what ever angle you want to stop at)Inside the rule:
change attribute/scene.Camera.Rotation=scene.Camera.Rotation+1 -
Tosanu Posts: 388
I notice you say = 45. But wont, at -2 a step, it go from 44 to 46 without touching 45?
Answers
Thank you for your help marcgreiff.
I'm trying the loop condition but it does not stop at 45º. It's some kind of newbie mistake?
Try interpolate.
You are totally right... forgot about that detail... It works fine now. Thank you all.