|
| 08 Aug 2016 05:09 PM |
so im just testing it out and i made this simple script
function swingopen() script.Parent.CFrame=CFrame.Angles(0,90,0) end
swingopen()
but it doesnt do what i want at all
this sets the position to 0,0,0 and sets the rotation to -180, 63.38, -180
u just got litt up |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 08 Aug 2016 05:10 PM |
local part = script.Parent
part.CFrame = part.CFrame * CFrame.Angles(0,math.rad(90),0)
|
|
|
| Report Abuse |
|
|
Isosta
|
  |
| Joined: 10 May 2015 |
| Total Posts: 14729 |
|
|
| 08 Aug 2016 05:10 PM |
script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(0,math.rad(90),0)
if you dont put math.rad, you're using radians, not degrees.
- pyth_n |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2016 05:11 PM |
oh i see
u just got litt up |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2016 05:13 PM |
if i wanted to change the cframe position but not the rotation, what would i do?
u just got litt up |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2016 05:14 PM |
CFrame.Angles(math.rad(x),math.rad(y),math.rad(z)) is similar to Rotation except usually local CFrame.new(x,y,z) is the same thing as position
And to add CFrames together use the * operator |
|
|
| Report Abuse |
|
|