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 » Scripting Helpers
Home Search
 

Steering Part of a Car Tool

Previous Thread :: Next Thread 
TSRDatabase is not online. TSRDatabase
Joined: 04 Aug 2011
Total Posts: 6
07 Aug 2011 10:37 PM
How would you steer the car? I'm not sure if I'm right or not with this, but would you need to make the lookVector of the car base the Hit of the Mouse when the MouseButton1Down event is fired, or am I wrong?
Report Abuse
tofwap is not online. tofwap
Joined: 06 Dec 2007
Total Posts: 6596
07 Aug 2011 10:41 PM
I'm actually developing my own car right now, and I can tell you i have had the most success with a BodyAngularVelocity object,

for some reason editing RotVelocity itself causes the car to freak out, I have it set up like so:

car.BodyAngularVelocity.angularvelocity=Vector3.new(0,-0.25,0)

just need to set up the keyup function for whatever button your using as the turning key
Report Abuse
TSRDatabase is not online. TSRDatabase
Joined: 04 Aug 2011
Total Posts: 6
07 Aug 2011 10:44 PM
It's the left mouse button, but how do you change the angularvelocity to where the mouse is clicked?
Report Abuse
tofwap is not online. tofwap
Joined: 06 Dec 2007
Total Posts: 6596
07 Aug 2011 10:47 PM
I have mine set up to monitor the a and d keys, if they press one down it will turn right(d key) and left (a key). When they let the button up i simply set the rotation back to 0.

If your trying to make a car using only one button then that's going to be more tricky I would probably try a script that subtracts the rotational difference from a CFrame using the BodyGyro object.
Report Abuse
TSRDatabase is not online. TSRDatabase
Joined: 04 Aug 2011
Total Posts: 6
07 Aug 2011 10:49 PM
Ohhhh that's how you're making your car. I got it. I want to make a car where it turns to where the mouse is when you click it. Do you (or anyone) know how to do that?
Report Abuse
tofwap is not online. tofwap
Joined: 06 Dec 2007
Total Posts: 6596
07 Aug 2011 10:55 PM
I don't at the moment know if i would be able to get that working.

If i had to make one i would put a BodyGyro in the engine brick (make the body gyro only effect the Y rotation) then

BodyGyro.cframe=CFrame.new(seat position,mouseposition)
Report Abuse
TSRDatabase is not online. TSRDatabase
Joined: 04 Aug 2011
Total Posts: 6
07 Aug 2011 11:00 PM
Hmmm. I think I'll try printing the Mouse's Hit property to see exactly how it works and how to apply it to the brick. Thnx fer halpin'! :3
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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