You do not need to use a BodyForce for this.
http://wiki.roblox.com/index.php?title=Making_a_Door
This could work for opening the door:
local door = script.Parent
local cpos = door.Position
local opos = Vector3.new(0,0,0)
local bp = Instance.new(¨BodyPosition¨,door)
bp.Position = door.Position
local open = false
door.Touched:connect(function(hit)
local p = game.Players:GetPlayerFromCharacter(hit.Parent)
if p then
if open == false then
open == true
bp.Position = opos
repeat wait() until door.Position == opos
wait(3)
bp.Position = cpos
repeat wait() until door.Position == cpos
open = false
end
end
end)
2 comments
Can't you just use hinges?
I'm looking to make a scripted animation.