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

Why doesn't my script set the body position of body position?

when i fire the cannon it just falls out, i printed the result and it isn't what i want, it comes out as 0,0,0

here's the code

game.ReplicatedStorage.FireRoundshot.OnServerEvent:Connect(function(player, Vseat)
	if Vseat == script.Parent then
		local roundshot = player.Backpack:FindFirstChild("Roundshot")
		if roundshot == nil then
			print("NoRoundshot")
		else
			roundshot:Destroy()
			local newRS = game.ReplicatedStorage.Roundshot:Clone()
			newRS.CFrame = CFrame.new(script.Parent.Parent.RoundshotPlacement.Position)
			newRS.Parent = game.Workspace
			newRS.BodyForce.Position = Vector3.new(script.Parent.Parent.RoundshotGoTo.Position)
			newRS.Origin.Value = script.Parent.Parent.Parent.PrimaryPart
			print(newRS.BodyForce.Position)
			wait(0.6)
			newRS.BodyForce:Destroy()
			newRS.Script.Disabled = false
			
		end
	end
end)

3 comments

0

my body position is called "BodyForce"

0

Do you get the correct position if you print script.Parent.Parent.RoundshotGoTo.Position?

0

nvm its all good someone in the DC server helped

1 answer

instead of Vector3.new() use just the raw postion rs.BodyThingy.postition = somepart.position

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