grilme99
|
  |
| Joined: 30 Dec 2014 |
| Total Posts: 173 |
|
|
| 16 May 2017 10:53 AM |
Hey there,
I'm currently working on a fighter ship game and I'm working on a custom ship system. Inside the ships BasePart there is a BodyAngularVelocity, BodyGyro and a BodyVelocity. and I need to ship to constantly move forward (Which I can do) but it also needs to rotate depending on where the mouse is on the screen, say you moved it to the right your ship would move to the right, iv attempted this many times and have searched and searched for tutorials relating to it but can't find anything that helps me. If someone could help me out with a script that would be great!
grilme99, creator of Space Reflex. |
|
|
| Report Abuse |
|
|
grilme99
|
  |
| Joined: 30 Dec 2014 |
| Total Posts: 173 |
|
|
| 16 May 2017 10:56 AM |
... Why did it post 2..?
grilme99, creator of Space Reflex. |
|
|
| Report Abuse |
|
|
DevJoas
|
  |
| Joined: 17 Dec 2014 |
| Total Posts: 627 |
|
|
| 16 May 2017 10:59 AM |
I think you can do this with the mouse and camera methods:
wiki.roblox.com/index.php?title=API:Class/Mouse
wiki.roblox.com/index.php?title=API:Class/Camera
wiki.roblox.com/index.php?title=API:Class/Camera/ViewportPointToRay |
|
|
| Report Abuse |
|
|
grilme99
|
  |
| Joined: 30 Dec 2014 |
| Total Posts: 173 |
|
|
| 16 May 2017 11:02 AM |
I know I could use the ray and that's fine but I need a way to actually rotate the part point the part at where the way is facing.
grilme99, creator of Space Reflex. |
|
|
| Report Abuse |
|
|
DevJoas
|
  |
| Joined: 17 Dec 2014 |
| Total Posts: 627 |
|
|
| 16 May 2017 11:03 AM |
Use a BodyGyro
wiki.roblox.com/index.php?title=API:Class/BodyGyro |
|
|
| Report Abuse |
|
|
grilme99
|
  |
| Joined: 30 Dec 2014 |
| Total Posts: 173 |
|
|
| 16 May 2017 11:05 AM |
Ok, I'll give it a go.
grilme99, creator of Space Reflex. |
|
|
| Report Abuse |
|
|
grilme99
|
  |
| Joined: 30 Dec 2014 |
| Total Posts: 173 |
|
|
| 16 May 2017 11:09 AM |
Body gyro doesn't work. There is no way to actually control where it gets rotated to.
grilme99, creator of Space Reflex. |
|
|
| Report Abuse |
|
|
DevJoas
|
  |
| Joined: 17 Dec 2014 |
| Total Posts: 627 |
|
|
| 16 May 2017 11:10 AM |
Yes there is? Just set the CFrame value |
|
|
| Report Abuse |
|
|
grilme99
|
  |
| Joined: 30 Dec 2014 |
| Total Posts: 173 |
|
|
| 16 May 2017 11:15 AM |
Ok now I get the error: bad argument #1 to 'new' (Vector3 expected, got CFrame) Is there a way to turn a CFrame into a Vector3?
grilme99, creator of Space Reflex. |
|
|
| Report Abuse |
|
|
DevJoas
|
  |
| Joined: 17 Dec 2014 |
| Total Posts: 627 |
|
|
| 16 May 2017 11:16 AM |
wiki.roblox.com/index.php?title=CFrame
The wiki is your best friend man.
Look for answers there first before asking simple questions here |
|
|
| Report Abuse |
|
|