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: floating

Previous Thread :: Next Thread 
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Mar 2017 11:07 AM
I'm so lost how to make this ball float. On the touch of a player i just want it to float up a tad toward their direction they hit it from and go down, JUST A TAD

ugh
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Mar 2017 11:13 AM
help
Report Abuse
FloweryMonkeyboy5 is not online. FloweryMonkeyboy5
Joined: 19 Sep 2012
Total Posts: 528
04 Mar 2017 11:14 AM
What exactly do you mean with "float up toward their direction".

Do you want to make it float straight up or at an angle towards the user?
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Mar 2017 11:16 AM
whatever way they hit it upward a tad but then it will fall
Report Abuse
FloweryMonkeyboy5 is not online. FloweryMonkeyboy5
Joined: 19 Sep 2012
Total Posts: 528
04 Mar 2017 11:18 AM
Alright, so when I come from the south, the ball flies up towards the north and goes down just after?
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Mar 2017 11:20 AM
yes, it's sorta like a lesser gravity ball but not even close to no gravity, it just flioats
Report Abuse
FloweryMonkeyboy5 is not online. FloweryMonkeyboy5
Joined: 19 Sep 2012
Total Posts: 528
04 Mar 2017 11:22 AM
The basic idea of that would be as soon as the user hits the ball, check the magnitude between the ball and the torso of the human. The magnitude is basically the length of a vector.
Even better would be to take the unit, this is a normalized version of the magnitude so you can multiply it for accurate results.

After that you'd have to invert the unit because you want the ball to fly the opposite direction.

Then make a BodyThrust object and set the force to the value of the unit you calculated.
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Mar 2017 11:25 AM
Can u code it I'm confused
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Mar 2017 11:29 AM
help
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Mar 2017 11:32 AM
helpp
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Mar 2017 11:35 AM
?????
Report Abuse
FloweryMonkeyboy5 is not online. FloweryMonkeyboy5
Joined: 19 Sep 2012
Total Posts: 528
04 Mar 2017 11:35 AM
Something like this, I haven't tested it so it may not work:

script.Parent.Touched:connect(function(other)
if other.Parent:FindFirstChild("HumanoidRootPart") then
local unit = (script.Parent.Position - other.Parent.HumanoidRootPart.Position).unit
local inverse = CFrame.new(unit):inverse()
script.Parent.BodyThrust.Force = inverse
end
end)
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Mar 2017 11:38 AM
it didnt work
Report Abuse
FloweryMonkeyboy5 is not online. FloweryMonkeyboy5
Joined: 19 Sep 2012
Total Posts: 528
04 Mar 2017 11:39 AM
Yeah I made a mistake, BodyThrust.Force is a vector, not a cframe: Use this instead and change out BodyThrust ### # ######### script.Parent.BodyForce.Force = Vector3.new(inverse.X, inverse.Y, inverse.Z)
Report Abuse
FloweryMonkeyboy5 is not online. FloweryMonkeyboy5
Joined: 19 Sep 2012
Total Posts: 528
04 Mar 2017 11:40 AM
Also, put this script inside the ball and place a BodyForce object under the ball aswell.
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Mar 2017 11:41 AM
STILL DIDNT WORK/
Report Abuse
JonathanW123 is not online. JonathanW123
Joined: 04 Apr 2012
Total Posts: 5832
04 Mar 2017 11:46 AM
error error
Report Abuse
FloweryMonkeyboy5 is not online. FloweryMonkeyboy5
Joined: 19 Sep 2012
Total Posts: 528
04 Mar 2017 11:48 AM
Instead of posting "IT DOESN'T WORK" or "error error" it would be more useful if you posted what error ...
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