|
| 12 Jan 2014 08:57 AM |
So, I have this script.
function rotate(x,y,z) angle = angle + x print(angle) turret.Seat.CFrame = turret.Seat.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(x),math.rad(y),math.rad(z)) end
while wait() do if fdown == true then rotate(0,1,0) end if gdown == true then rotate(-1,0,0) end if hdown == true then rotate(0,-1,0) end if tdown == true then rotate(1,0,0) end end
But I want to put a limit on the amount you can rotate. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
Nyxis
|
  |
| Joined: 15 Nov 2012 |
| Total Posts: 3374 |
|
| |
|
| |
|
|
| 12 Jan 2014 09:43 AM |
So, I added in a check rotation, like so:
function rotate(x,y,z) if seat.Rotation.X < 70 then turret.Seat.CFrame = turret.Seat.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(x),math.rad(y),math.rad(z)) end end
But it breaks. Help? |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Jan 2014 10:01 AM |
| Your not calling the function ._. |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2014 10:06 AM |
| No, I did in the rest of the script. The script is over 500 lines, and I didn't want to post it all here. Can someone please just help me limit the x axis? |
|
|
| Report Abuse |
|
|
|
| 12 Jan 2014 10:10 AM |
| What happens is whenever it hits the limit, it adds to the rotation, therefor breaking it. How do I fix this? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|