Im am a fairly new to coding and i am try to make a lava trap for a little obby project. I seen the roblox hour of code video using body position to make the part move. I used this on a different trap and it worked. But a few weeks later the body position didnt go to the position i set it on in the script. And now it wont work on this trap. please help me fix this.
I tried using just position and vector3s instead of
Bodyposition.position = PartNameGoesHere.position
local start = game.Worksapce.Start local End = game.Workspace.End local turn = game.Workspace.turn local turn2 = game.Workspace.turn2 local LF = game.Workspace.LavaForFall while true do script.Parent.BodyPosition.position = End.position end
In your line 8,
script.Parent.BodyPosition.Position = End.Position
the p
in position needs to be capitalized.
if i still doesn't work, consider trying CFrame, but try the above first
I have figured out a solution to my own problem. I used instance.new() to create a body position in the script instead of putting it in ROBLOX studio my self. from creating it in the script i can now put it into a variable. local movement/(AnyOtherName) = instance.new("Bodyposition") then within a while true do statement i can use the lines
Movement.Position = part.Position
then i can repeat the process with waits and more
My Full Code
local Movement = Instance.new("BodyPosition") Movement.Parent = script.Parent local P1 = game.Workspace.P1 local P2 = game.Workspace.P2 local End = game.Workspace.edn local start = game.Workspace.Start P1.Transparency = 1 P2.Transparency = 1 start.Transparency = 1 End.Transparency = 1 while true do Movement.Position = End.Position wait(0.5) Movement.Position = P1.Position wait(0.5) Movement.Position = P2.Position wait(0.5) Movement.Position = start.Position end