Stiiky
|
  |
| Joined: 15 Jan 2010 |
| Total Posts: 451 |
|
|
| 01 Mar 2016 10:11 PM |
Is there a way you can move parts with scripts ignoing rotation, example something rotated at 90 degrees kinda goes down and right at the same time. Can you move parts in ROBLOX ignoring rotation? Like when you hit ctrl+l in studio and it instead moves it on the axis rather than the axis of the part.
I feel like this is really simple to do, but just cant figure it out. Please help!
I've done nothing but teleport my cat for 3 days. |
|
|
| Report Abuse |
|
|
|
| 01 Mar 2016 10:12 PM |
http://wiki.roblox.com/index.php?title=Position
|
|
|
| Report Abuse |
|
|
Stiiky
|
  |
| Joined: 15 Jan 2010 |
| Total Posts: 451 |
|
|
| 01 Mar 2016 10:13 PM |
I know how to use position. Im asking how to make something move meanwhile ignoring its rotation so that it moves on the worlds axis, not the parts axis.
I've done nothing but teleport my cat for 3 days. |
|
|
| Report Abuse |
|
|
Zechariax
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 206 |
|
|
| 01 Mar 2016 10:13 PM |
local x = game.Workspace.Part
x.Position = x.Position + Vector3.new(0,3,1) |
|
|
| Report Abuse |
|
|
Stiiky
|
  |
| Joined: 15 Jan 2010 |
| Total Posts: 451 |
|
|
| 01 Mar 2016 10:14 PM |
That doesnt ignore the parts axis.. If the part is tilted, it'll move diagonaly.
I've done nothing but teleport my cat for 3 days. |
|
|
| Report Abuse |
|
|
Zechariax
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 206 |
|
|
| 01 Mar 2016 10:16 PM |
p.CFrame = CFrame.new(0,3,0):toWorldSpace(p.CFrame)
|
|
|
| Report Abuse |
|
|
Zechariax
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 206 |
|
|
| 01 Mar 2016 10:16 PM |
| replace p with your part and CFrame.new(x,y,z) with your coordinate shift relative to the part. |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 01 Mar 2016 10:17 PM |
Part.CFrame = Part.CFrame + Vector3.new(0,5,0)
That moves the part upwards 5 studs relative to global space. |
|
|
| Report Abuse |
|
|
Stiiky
|
  |
| Joined: 15 Jan 2010 |
| Total Posts: 451 |
|
|
| 01 Mar 2016 10:41 PM |
I used this (theirs a loop before it) and I just did the same thing as before, the Part went to the right, and the union went into the ground kinda going to the right also.
for _,v in pairs(script.Parent:GetChildren()) do if v:IsA("BasePart") then v.CFrame = v.CFrame*CFrame.new(0,amount,0) elseif v:IsA("UnionOperation") then v.CFrame = v.CFrame*CFrame.new(0,amount,0):toWorldSpace(v.CFrame) end
I've done nothing but teleport my cat for 3 days. |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 01 Mar 2016 10:42 PM |
for _,v in pairs(script.Parent:GetChildren()) do if v:IsA("BasePart") then v.CFrame = v.CFrame+Vector3.new(0,amount,0) elseif v:IsA("UnionOperation") then v.CFrame = v.CFrame+Vector3.new(0,amount,0) end
|
|
|
| Report Abuse |
|
|
|
| 02 Mar 2016 12:26 AM |
'That doesnt ignore the parts axis.. If the part is tilted, it'll move diagonaly.' Not true. |
|
|
| Report Abuse |
|
|
Zechariax
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 206 |
|
|
| 02 Mar 2016 12:46 AM |
| Yeah, ik. I just tried it out right now and went like "what is he talking about". I was right the first time I guess he made me right an alternative. But then how would I go about moving it ON THE LOCAL AXIS? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 02 Mar 2016 12:47 AM |
.CF = .CF * CF .Position = .CF * V3 |
|
|
| Report Abuse |
|
|
Zechariax
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 206 |
|
|
| 02 Mar 2016 12:47 AM |
nvm, i got it.
p.CFrame = p.CFrame * CFrame.new(0,10,0) |
|
|
| Report Abuse |
|
|