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: What type of bodymover should I use?

Previous Thread :: Next Thread 
Leg0brick is not online. Leg0brick
Joined: 24 Jul 2012
Total Posts: 651
10 Apr 2016 10:21 PM
I am trying to make a part move while someone is pressing a key, but I'm not sure what type of BodyMover I should use to achieve this. Or how to use it. Any help is appreciated.


#code while wait() do print("ServerStorage > Lighting") end
Report Abuse
Leg0brick is not online. Leg0brick
Joined: 24 Jul 2012
Total Posts: 651
10 Apr 2016 10:27 PM
bump


#code while wait() do print("ServerStorage > Lighting") end
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
10 Apr 2016 10:32 PM
It really depends on what you want to use it for.
Any kind of BodyMover outside of BodyGyro and BodyAngularVelocity could move it. It really depends on what would be easier and your approach.

BodyVelocity tries to set a permanent velocity to the part (Gravity still happens, but nowhere near as much)

BodyForce sets a constant acceleration to the part in world space.

BodyThrust sets a constant acceleration to the part in local space.

BodyPosition tries to get the part to fly to and stay at the specified position.

RocketPropulsion tries to get a part to fly towards another.


Report Abuse
Leg0brick is not online. Leg0brick
Joined: 24 Jul 2012
Total Posts: 651
10 Apr 2016 10:59 PM
Imagine a one brick car. If I press w it moves forward, if I press s it moves backwards, etc...


#code while wait() do print("ServerStorage > Lighting") end
Report Abuse
LordKreduken is not online. LordKreduken
Joined: 07 Sep 2013
Total Posts: 109
10 Apr 2016 11:01 PM
do bodythrust then
Report Abuse
Leg0brick is not online. Leg0brick
Joined: 24 Jul 2012
Total Posts: 651
10 Apr 2016 11:39 PM
Alright, this is what I have. But it's not functioning at all. It prints 1 but doesn't move. Please note that this is my first time working with any type of bodymover...

function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.W then
print(1)
Instance.new("BodyThrust",bot)
bot.BodyThrust.Force = Vector3.new(0,100,0)
end
end

game:GetService("UserInputService").InputBegan:connect(onKeyPress)


#code while wait() do print("ServerStorage > Lighting") end
Report Abuse
Brick_Wizard is not online. Brick_Wizard
Joined: 15 Mar 2016
Total Posts: 2072
10 Apr 2016 11:41 PM
Just a side note:

if inputObject.KeyCode == Enum.KeyCode.W and not gameProcessedEvent then -- It stops it going off when you type in chat.


Report Abuse
Leg0brick is not online. Leg0brick
Joined: 24 Jul 2012
Total Posts: 651
11 Apr 2016 12:56 AM
b


#code while wait() do print("ServerStorage > Lighting") end
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