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

Help with BodyPosition?

Asked by
FiredDusk 1466 Moderation Voter
8 years ago

I am trying to make a part move if they click a part named "Bell". It is not working. Inside the part that I want moved it has a BodyGyro, BodyPosition, and this script:

bp = script.Parent.BodyPosition
if game.Workspace.Door.DoorBell.Bell.Transparency == 0.5 then
    script.Parent.BodyPosition.Position = Vector3.new(bp.x-20, bp.y, bp.z)
end

1 answer

Log in to vote
0
Answered by
Im_Kritz 334 Moderation Voter
8 years ago

Your problem is that x, y and z are not valid properties of BodyPosition. I think you meant to say:

local bp = script.Parent.BodyPosition
if game.Workspace.Door.DoorBell.Bell.Transparency == 0.5 then
    bp.Position = Vector3.new(bp.Position.x-20, bp.Position.y, bp.Position.z)
end
Ad

Answer this question