generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Rotation a part depending on the mouse position.

Previous Thread :: Next Thread 
grilme99 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image