Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Andys on March 28, 2013, 09:30:25 AM
-
I have a gun on a tank i want to move up and down, the attached screen shot shows what i have done and works, but it will rotate a full 360deg, how can I clamp this to only work between two values? say 0 to 90 deg, I tried a few different ways, but as i am quite new to the working of playmaker, struggle to find the correct action
Andy
-
You should be rotating X axis for up/down, so i assume you pre-rotated a cylinder for the tank barrel, thereby fucking up its axis. Don't scale/rotate objects inside unity, do it in your 3D application, else it becomes a mess to work with later on.
Maybe "get rotation" then "math clamp" on that? Might need to use set rotation as well, not sure.
-
Managed to sort it out, used get position, stored it in a variable, then used get vector3 XYZ and stored the Y in another variable, then did a float compare to stop the rotation, then reset with get key up for up and down.
Andy