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: BodyPosition not properly working?

Previous Thread :: Next Thread 
Raildex is not online. Raildex
Joined: 06 Dec 2009
Total Posts: 934
10 Apr 2017 07:09 PM
So I have a script which Im using to simulate hovering and it seems to be doing its job however, the body positions in the parts arent functioning right. Say one on one side has a height to go to of 6 whereas on the other side you have it trying to reach 9. It doesnt update properly and so the 6 can end up higher up then the 9 and it will stay that way, I cant figure out why they arent properly moving themsleves

local SuperPart = Instance.new("Egg")
Report Abuse
Raildex is not online. Raildex
Joined: 06 Dec 2009
Total Posts: 934
10 Apr 2017 07:20 PM
I have noticed that it somewhat updates on contact with another object. Also here is my code. The code however is working fine. local push = 4 function getHoverPos(part) local ### # ######## part.Position + Vector3.new(0,10,0), -- origin Vector3.new(0,-1,0) * 20 -- direction ) local hitPart, position, normal, material = workspace:FindPartOnRay (ray, part.Parent) return position end while wait() do for i, hoverPart in pairs (script.Parent:GetChildren()) do if hoverPart:FindFirstChild("BodyPosition") then hoverPart.BodyPosition.Position = getHoverPos(hoverPart) + Vector3.new(0,push,0) end end end local SuperPart = Instance.new("Egg")
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
10 Apr 2017 07:23 PM
u dont need to use body position to make something hover, if this isnt working u could try my example model
if u dont want to use that then u probably need more force used
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
10 Apr 2017 07:25 PM
also if the ray is missing it should be done like this


print( workspace:FindPartOnRay( Ray.new( part.Position, part.CFrame.upVector * -distance ) ) )

then you use that distance received to control hover height by maybe making it move to something like hit + Vector3.new(0, height, 0)
Report Abuse
Raildex is not online. Raildex
Joined: 06 Dec 2009
Total Posts: 934
10 Apr 2017 07:28 PM
The issue isnt the code, I know this because I can check the body positions as theyre moving and see what they should be trying to get to, however there are times when the whole thing just runs out of energy it seems and just kaputs right there, but the positions are still displaying they are trying to get to the correct points but in reality they dont do anything,

local SuperPart = Instance.new("Egg")
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
10 Apr 2017 07:29 PM
then either it requires more force or its an issue with the weight or positioning system
Report Abuse
Raildex is not online. Raildex
Joined: 06 Dec 2009
Total Posts: 934
10 Apr 2017 07:33 PM
All im testing with is a brick with 4 bricks attached to its corners to be the points where the bodypositions are. It has enough force as I have cranked it way up multiple times to test this, plus it always goes to the correct rotation when I start it up

local SuperPart = Instance.new("Egg")
Report Abuse
baconmystomach is not online. baconmystomach
Joined: 05 May 2013
Total Posts: 188
10 Apr 2017 07:38 PM
I've been having the same problem with body position, in the position slot in properties it says its moving but in the 3d work space it just sits there.
Report Abuse
Raildex is not online. Raildex
Joined: 06 Dec 2009
Total Posts: 934
10 Apr 2017 07:39 PM
@baconmystomach yes that sums up my issues, have you found any solutions or reasons why this is happening?

local SuperPart = Instance.new("Egg")
Report Abuse
baconmystomach is not online. baconmystomach
Joined: 05 May 2013
Total Posts: 188
10 Apr 2017 07:45 PM
no, but I highly suggest finding a free model of hovering or a moving platform or really any free model that uses body position.
Report Abuse
Raildex is not online. Raildex
Joined: 06 Dec 2009
Total Posts: 934
10 Apr 2017 08:52 PM
How would that help fix my problem??

local SuperPart = Instance.new("Egg")
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
10 Apr 2017 09:07 PM
try to use my model of hovering, it works just fine, just use a body position to control how far it moves in the left and right directions only

it already has a body gyro for stabilization, u can weaken or remove it
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
10 Apr 2017 09:08 PM
u can change hoverstyle using the free length and the damping settings for smoothness and stiffness for power in the spring
Report Abuse
Raildex is not online. Raildex
Joined: 06 Dec 2009
Total Posts: 934
10 Apr 2017 09:55 PM
That doesnt accomplish what I'm aiming for at all.

local SuperPart = Instance.new("Egg")
Report Abuse
Raildex is not online. Raildex
Joined: 06 Dec 2009
Total Posts: 934
11 Apr 2017 12:13 PM
bump

local SuperPart = Instance.new("Egg")
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