I want to make so the canister checks the ground, finds part that is ground rn using raycast and sets canister’s position above the ground (Like, stands on the ground, lays on it)
-- Issue is here
local connection
connection = re.OnServerEvent:Connect(function(plr)
if plr.Character:FindFirstChild("Humanoid") and not bounced and plr.Character:FindFirstChild("WhaleTank") then
local rayOrigin = Middle.Position
local rayDirection = Vector3.new(0, -10, 0)
local raycastResult = workspace:Raycast(rayOrigin, rayDirection)
if raycastResult and raycastResult.Instance then
bounced = true
prompt.Enabled = true
local char = plr.Character
char.Humanoid.WalkSpeed = 16
animationTrack:Stop()
local weld = char.Torso.WeldConstraint
weld:Destroy()
model.Parent = workspace
Middle.Anchored = true
model:SetPrimaryPartCFrame(CFrame.new(char.Torso.Position + char.Torso.CFrame.LookVector*2))
end
delay(0.5,function()
bounced = false
end)
end
end)
I can’t make that work, lol.
I haven’t tried much yet, I’m open to your suggestions and help.