Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I need help, the orb is falling? [ANSWERED, LOOK BELOW]

For some reason my orb is falling maybe it is gravity?

local players =game:GetService("Players")
local rp = game:GetService("ReplicatedStorage")
local ShootHeal = rp:WaitForChild("ShootHeal")

ShootHeal.OnServerEvent:Connect(function(plr,mouseHit,tool)
	local HealSphere = Instance.new('Part',workspace)
	HealSphere.Shape = Enum.PartType.Ball
	HealSphere.CanCollide = false
	HealSphere.BrickColor = BrickColor.new("Lime green")
	HealSphere.Material = Enum.Material.Neon
	HealSphere.Massless = true
	
	HealSphere.Position = tool.Handle.Position
	
	local BodyVelocity = Instance.new("BodyVelocity", HealSphere)
	BodyVelocity.Force = mouseHit.LookVector * 20
		
end)

4 answers

local players =game:GetService("Players")
local rp = game:GetService("ReplicatedStorage")
local ShootHeal = rp:WaitForChild("ShootHeal")

ShootHeal.OnServerEvent:Connect(function(plr,mouseHit,tool)
    local HealSphere = Instance.new('Part',workspace)
HealSphere.Anchored = true
    HealSphere.Shape = Enum.PartType.Ball
    HealSphere.CanCollide = false
    HealSphere.BrickColor = BrickColor.new("Lime green")
    HealSphere.Material = Enum.Material.Neon
    HealSphere.Massless = true
    HealSphere.Position = tool.Handle.Position
    local BodyVelocity = Instance.new("BodyVelocity", HealSphere)
    BodyVelocity.Force = mouseHit.LookVector * 20

end)

You can set the BodyVelocity.MaxForce higher... Like Vector3.new(1000000,1000000,1000000)

I found out a fix, It uses a BodyForce, and I accidently called my BodyVelocity.Force, bodyvelocity's dont have a force, they have velocity. Here is my code:


local players =game:GetService("Players")
local rp = game:GetService("ReplicatedStorage")
local ShootHeal = rp:WaitForChild("ShootHeal")

ShootHeal.OnServerEvent:Connect(function(plr,mouseHit,tool)
	local HealSphere = Instance.new('Part',workspace)
	HealSphere.Shape = Enum.PartType.Ball
	HealSphere.CanCollide = false
	HealSphere.BrickColor = BrickColor.new("Lime green")
	HealSphere.Material = Enum.Material.Neon
	HealSphere.Massless = true
	
	HealSphere.Position = tool.Handle.Position
	
	local BodyVelocity = Instance.new("BodyVelocity", HealSphere)
	BodyVelocity.Velocity = mouseHit.LookVector * 20
	
	local BodyForce = Instance.new("BodyForce")
	BodyForce.Parent = HealSphere
	BodyForce.Force = Vector3.new(0,workspace.Gravity * HealSphere:GetMass(),0)
	
		
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.