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

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

Asked by 4 years ago
Edited 4 years ago

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

Log in to vote
0
Answered by
JesseSong 3916 Moderation Voter Community Moderator
4 years ago
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)
Ad
Log in to vote
0
Answered by 4 years ago

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

Log in to vote
0
Answered by 4 years ago

Anchor maybe ? I have no idea

Log in to vote
0
Answered by 4 years ago

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)

Answer this question