WilhelmP
|
  |
| Joined: 27 Aug 2014 |
| Total Posts: 28 |
|
|
| 15 Nov 2016 11:08 AM |
Hi, I want to start making games for roblox and i need help with a script. I want to know how to creat rotationbased mopvement. what i mean is that i want a thing to move forwarn no mater what direction its facing. Ive seached on google but i cant fing how to do it. Help would be much appreciated.
/WilhelmP |
|
|
| Report Abuse |
|
|
Thedagz
|
  |
| Joined: 10 Mar 2012 |
| Total Posts: 798 |
|
|
| 15 Nov 2016 11:14 AM |
local Part = game.Workspace:WaitForChild("Part") while true do Part.CFrame = Part.CFrame + Vector3.new(0,0,0.1) wait(0.2) end |
|
|
| Report Abuse |
|
|
WilhelmP
|
  |
| Joined: 27 Aug 2014 |
| Total Posts: 28 |
|
| |
|
|
| 15 Nov 2016 11:22 AM |
I have no idea what thedagz posted but it was definitely not what you wanted
Can you expand on what you want? The movement like when in shift-lock?
|
|
|
| Report Abuse |
|
|
WilhelmP
|
  |
| Joined: 27 Aug 2014 |
| Total Posts: 28 |
|
|
| 15 Nov 2016 11:32 AM |
| if i want to build a flying vehicle i dont want it to fly backwards if its rotated and i press "w". so if its facing south and i press "w" it will go south and so on in all directions. no need for how to do the buttonpressing thing since i know that. |
|
|
| Report Abuse |
|
|
WilhelmP
|
  |
| Joined: 27 Aug 2014 |
| Total Posts: 28 |
|
|
| 15 Nov 2016 11:33 AM |
| think of the character in firstperson mode, it goes forwards |
|
|
| Report Abuse |
|
|
Auzer
|
  |
| Joined: 24 Dec 2011 |
| Total Posts: 1590 |
|
|
| 15 Nov 2016 12:05 PM |
You want a part that moves in world space
part = Instance.new("Part", workspace) while part and wait() do part.CFrame = part.CFrame * CFrame.Angles(0, 0.02, 0) + Vector3.new(0.1, 0, 0) end
|
|
|
| Report Abuse |
|
|
WilhelmP
|
  |
| Joined: 27 Aug 2014 |
| Total Posts: 28 |
|
|
| 15 Nov 2016 01:36 PM |
| nope, not working, just a rotating part going in the positiv x direction. |
|
|
| Report Abuse |
|
|
Auzer
|
  |
| Joined: 24 Dec 2011 |
| Total Posts: 1590 |
|
|
| 17 Nov 2016 06:41 AM |
"move forwarn no mater what direction its facing". That's pretty much what the part does. No matter the rotation it will still move forward on the x axis.
|
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 17 Nov 2016 09:24 AM |
part.CFrame = part.CFrame * CFrame.new(0, 0, -2)
it's that simple. |
|
|
| Report Abuse |
|
|
WilhelmP
|
  |
| Joined: 27 Aug 2014 |
| Total Posts: 28 |
|
|
| 21 Nov 2016 12:26 PM |
| you don't understand. think of a firstperson game. |
|
|
| Report Abuse |
|
|
WilhelmP
|
  |
| Joined: 27 Aug 2014 |
| Total Posts: 28 |
|
|
| 22 Nov 2016 06:15 AM |
| Thank you cntkillme :D it worked |
|
|
| Report Abuse |
|
|