Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to create a floating block?

Asked by 9 years ago

How can you create a floating block? like it just slowly goes down and comes back up.

As if something was floating in mid air, nothing is making it happen.

I'm not talking about anchoring either.

0
You would use a BodyForce object and set the force to a favorable amount, you would then set the position of that BodyForce object in the script to make it appear to be 'floating'. M39a9am3R 3210 — 9y

1 answer

Log in to vote
2
Answered by
ImageLabel 1541 Moderation Voter
9 years ago

You would want to use a BodyMover. I would recommend BodyVelocity, because it allows you to apply force to an object/instance, until it reaches a certain velocity. Given that your objective is to have it floating, this instance would be optimal.

The following is an example of how you'd implement it to an object. I will instantiate a Part in the process just for demonstrative purposes.

local part = Instance.new("Part")
part.Parent = workspace

local move = Instance.new("BodyVelocity")
move.maxForce = Vector3.new(0,3e3,0) -- amount of force applied on
-- each axis.
move.Parent = part
move.P = 1000
Ad

Answer this question