So, I'm making a water bottle flip game dead trend ik. Anyway I've made it so that if the bottle touches the table it resets. It only does not reset if the bottom of the bottle touches the table(which is a separate part, part2 in this case.) the thing is part2 is only there for verification however it needs to rotate with the bottle in order to do that.

at the moment part2 impacts the flip as shown in this video

https://www.youtube.com/watch?v=81fC1N6wiXQ&feature=youtu.be

is there anyway to prevent this from happening or specifying the bottom surface of the bottle (which is a union)

--variables
secs = 0
ply = game.Players.LocalPlayer
mouse = ply:GetMouse()
go = false
part = game.Workspace.WBM.Union
part2 = game.Workspace.WBM.Part
secs = 0.3
win = false
start = false

--NEED TO EDIT PROPERTY OF PART2 TO MAKE IT HAVE NO EFFECT ON BOTTLE

--creates function
function Up()
    part.CFrame = part.CFrame + Vector3.new(0,secs,0)
end







--leftROTATON

function Leftmove()
	part.CFrame = part.CFrame * CFrame.Angles(0.1,0,0)
end







--RightRotation



--creates loop
while true do
mouse.Button1Down:connect(function()
	go = true
	start = true
	part.Anchored = true 
	part2.Anchored = true
end)

mouse.Button1Up:connect(function()
	go = false
	start = true
	part.Anchored = false
	part2.Anchored = false--edited
end)

if go == true and start == true then--up motion
	Up()
	Leftmove()
else if go == false and start == true then 
	Leftmove()--down motion
	wait(0.01)
	part2.BodyThrust.force = Vector3.new(0,0,0)
	Instance.new("BodyForce",part2).force = Vector3.new(0, part2:GetMass(), 0)
	
end

game.Workspace.WBM.Union.Touched:connect(function(hit)
	local find = hit.Parent:FindFirstChild("top")
	if find ~= nil then
		part.CFrame = CFrame.new(12.37, 2.98, -19.72)
		win = false
		part.Anchored = true
		game.Workspace.WBM.Part.Anchored = true
		go = false
		start = false
		wait(0.01)
	else
		win = true
	end
end) --- need to use variable, left from movement script somehow

wait(0.01)
end
wait()
end









--rotation













sorry for the lengthy read, any help is appreciated :D

2 comments

0

Weld it to the bottle?

0

I already did that