01 | wait( 1 ) |
02 |
03 | local player = game.Players.LocalPlayer |
04 | local Mouse = player:GetMouse() |
05 | local humanoid = player.Character.Humanoid |
06 | local s = humanoid:LoadAnimation(game.StarterPack.Fireball.Animation) |
07 |
08 | Player = script.Parent.Parent |
09 | Character = Player.Character |
10 | Mouse = Player:GetMouse() |
11 | usable = true |
12 | debounce = false |
13 |
14 | function onKeyDown(key) |
15 | if debounce = = false then |
I tried to use BodyForce, I put it on 0,0,0 to give it 0 gravity so the brick won't spawn under the terrain I'm standing on. But the brick still has gravity and still spawns under the terrain. How do I fix?
First of all, you might want to set the part's position manually. "Removing gravity" on the part won't stop it from spawning under the terrain.
Second, setting a BodyForce of 0,0,0 does literally nothing. What you need to do is have the BodyForce push upwards to counter gravity. Here's what you're going to have to set it to:
1 | --Make sure to define BodyForce and part first |
2 | BodyForce.force = Vector 3. new( 0 , 196.2 , 0 ) * part:GetMass() |