I have a collision group set up such that objects with the same CollisionGroup with collide. I have this spinning obstacle set up here:
I set the spinning rods as well as the red bridge to collide, but it is not respecting the collision. We want to see the rods get “stuck” when it hits the bridge, but it just passes right through.
I suspect it is due to the way that I am rotating the rods. What can I do to make them spin and at the same thing respect the collision?
Script for spinning rod:
local rod = script.Parent
z = 0
local speed = 10
while true do
z = z+speed
rod.Orientation = Vector3.new(0,0,z)
wait()
end
local pushForce = 500
local function onTouched(other)
if other.CollisionGroup == rod.CollisionGroup then
bodyV.Velocity = (other.Position).unit * pushForce
bodyV.P = math.huge
bodyV.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bodyV.Parent = char.HumanoidRootPart
wait(0.1)
bodyV:Destroy()
end
end
rod.Touched:Connect(onTouched)