Why isn't my shoving block not shoving?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    A shoving block that shoves the player off.

  2. What is the issue? Include screenshots / videos if possible!
    The shoving block doesn’t push the player off instantly, but instead goes through the player.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried making the block thicker and used tween service, but it didn’t work.

Video of my friend going through the block:
https://gyazo.com/fdb45f928e990ae925b70a02cfcffd48

local tweenservice = game:GetService("TweenService")

while true do
	local info = TweenInfo.new(0.25)
	local goal = {}
	goal.CFrame = script.Parent.Side1.CFrame
	
	local tween = tweenservice:Create(script.Parent.Part, info, goal)
	tween:Play()
	
	wait(1.5)
	
	local info = TweenInfo.new(0.25)
	local goal = {}
	goal.CFrame = script.Parent.Side2.CFrame
	
	local tween = tweenservice:Create(script.Parent.Part, info, goal)
	tween:Play()
	
	wait(1.5)
end

Please help!

Edit: CanCollide is set to true

Hello, I assume it’s because your block is moving excessively fast, so the physics are not properly calculating. I’d rather use some trick than trying to push player by part using physics.

You should use Velocity to push player sideway along tweening.

Also, you should tween on client-side and set the position of part at server-side after tweening completed.
That’s because tweening on server-side will cause performance issues, and result in jittery movement instead of smooth movement, which is out of tweening’s purpose.

1 Like

Yes, I kind of agree with William. Try using a constraint on the block.

1 Like

PrismaticConstraint must be the thing you are talking about I guess.

1 Like

I have got it to work thank you so much for helping me everyone!