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
 

Re: BodyVelocity & BodyGyro

Previous Thread :: Next Thread 
Greyhound40 is not online. Greyhound40
Joined: 15 Oct 2008
Total Posts: 933
31 Oct 2012 12:45 PM
Hey, can anyone explain or link me to a webpage explaining BodyVelocity and BodyGyro?

If you can, much appriciated.
Report Abuse
Greyhound40 is not online. Greyhound40
Joined: 15 Oct 2008
Total Posts: 933
31 Oct 2012 12:46 PM
appreciated
Report Abuse
Riderj is not online. Riderj
Joined: 15 Aug 2011
Total Posts: 1534
31 Oct 2012 12:50 PM
BodyVelocity is a force applied to a world axis, BodyGyro is the rotation of an object.


E.G:

local BV = Instance.new("BodyVelocity",game.Workspace.Riderj.Torso)
BV.maxForce = Vector3.new(0,32000,0)
BV.velocity = Vector3.new(0,200,0)


This will constantly put a 'push' of 200 on the Y axis. The max force needs to be set to battle the gravity in game.
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
31 Oct 2012 12:53 PM
To clarify that great explaination a bit, it will get a "Push" to attempt to set its velocity to 200, once achieved or exeeded the BodyVelocity will "Pull" so that the object slows down to 200.
Report Abuse
Greyhound40 is not online. Greyhound40
Joined: 15 Oct 2008
Total Posts: 933
31 Oct 2012 12:53 PM
What does it push? Up, or down?
Report Abuse
Greyhound40 is not online. Greyhound40
Joined: 15 Oct 2008
Total Posts: 933
31 Oct 2012 12:54 PM
Oh. Okay...


So... Gyro? I'm not sure on that..
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
31 Oct 2012 12:56 PM
Gyro has a max torque it can use and it attempt to turn the brick to the angle that is set to it, Gyro.cframe = SetAngleHere.
The Body Velocity pushes and pulls on the axis you set it to if I set the velocity to 0,1,1 it will travel up at one stud per second and right at one stud per second, BUT only if it has enough max force to do so.
Report Abuse
Greyhound40 is not online. Greyhound40
Joined: 15 Oct 2008
Total Posts: 933
31 Oct 2012 01:11 PM
One last thing, if you will.

An example of use?
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
31 Oct 2012 01:15 PM
A scripted car might use one like this
while wait() do
speed = speed + script.Parent.Throttle
script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*Speed*script.Parent.Throttle
end
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
31 Oct 2012 01:16 PM
And for a gyro,
script.Parent.Parent.Turning.Gyro.cframe = script.Parent.CFrame.lookVector
Make it look where the script.Parent is looking, or atleast turning it the same direction.
Report Abuse
HaxHelper is not online. HaxHelper
Joined: 19 Dec 2009
Total Posts: 1208
31 Oct 2012 01:17 PM
Actually, an elevator uses both of these concepts.

A BodyGyro to keep it level, and a BodyPosition (like BodyVelocity, except with a set position) to move it.
Report Abuse
MrChubbs is not online. MrChubbs
Joined: 14 Oct 2010
Total Posts: 4969
31 Oct 2012 01:20 PM
Well so can a scripted car, I just chose not to use both in that way because it would be more complex than it needed to be.
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