How do you make a shoving platform?

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!
    I want to create a shoving platform that actually shoves a player.
  2. What is the issue? Include screenshots / videos if possible!
    My script goes through the player and doesn’t shove.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried going into a JTOH to look at the shoving platform script, but there wasn’t any.
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
    Here is my code!
function move(x,y,z)
	for i = 1,10 do
		script.Parent.Position = script.Parent.Position + Vector3.new(x,y,z)
		wait(0.01)
	end
end 

while true do
	move(1,0,0)
	move(-1,0,0)
end
3 Likes

Is this on a server script or client script?

A couple of things to think about, are you sure the objects are set to CanCollide = true. If not they will pass through each other like you’ve described.

Another method would be Tweening. Now a lot of people frown on Tweening on the server, however I believe this would be more than optimal for your needs. Take a look at this article:

It will essentially animate the “shover” into position and the physics will update accordingly. Essentially what you’re doing in the code above is teleporting the shover into position without giving the physics side of things a chance to see what’s happening.

Hope this helps,
-Tom :slight_smile:

3 Likes

I think this is because you are just setting the position of the part rather than tweening it (https://developer.roblox.com/en-us/api-reference/function/TweenService/Create)
Also check that CanColide is set to true, as Tom said

1 Like

Thank you I will check the links you guys sent! My cancollide is set to true btw.

Maybe you can look at the official kit by Jukereise?
Here’s a link to the kit if you need it: JToH Tower Creation Kit v5.2 - Roblox