Part Interactions help

I scripted a part to move forward and collide with an unanchored ball. When running the script, the part moves through the ball. I expected to see the ball interact and “bounce” forward when the moving part hits it.

The goal is to have a mechanical reaction where the ball gets hit and moves. After poking around with a couple basic ideas I am clueless to any good solutions to achieve this desired result. Any advice?

Here is a video showing the current issue:

3 Likes

Do you possibly check the ball?

Check CanCollide in the properties, if it is ever turned off, the block can go through.

1 Like

Yes, CanCollide is set to true.

1 Like

Both block and the ball? If possible.

Yes. Both parts are set to CanCollide = true

1 Like

Is the ball possibly be anchored?

1 Like

Ball is not anchored. Red part is anchored and scripted to move.

1 Like

Are you using TweenService, CFrame or Position by any chance? If so use a body velocity (make the parts front face look at the ball for this to work btw)

--whatever you sue to wait

local v=Instance.new("BodyVelocity")
v.Parent = part
v.Velocity = part.CFrame.LookVector * amount
v.MaxForce = Vector3.new(math.huge,math.huge,math.huge)

Because if you change the position or CFrame or tween it, it doesn’t count as it is moving at all so in which case it will be non colliding even though Collision is set to true

2 Likes

I have tried TweenService. Then when that did not work, I brute forced it with a simple for loop and Position vectors.

1 Like

Read my message again I edited it

Still no luck. I tried it out. Same issue.

Can you build a working example so I have better reference?

1 Like

Did you make it parented to the part and is the part’s front face facing the ball to check this add a decal with an image and make it on the front then make the front face the ball

1 Like

it may be welded remove weld from it

Yes, I did all of that.

Will it move the part ??? Or is it stuck right there

No welds going on in this demo.

It looks like it is connected to the wall make sure it is not touching the wall and make sure it isn’t anchored since it can’t be that part that is meant to move with the BodyVelocity cannot be anchored

It will not move the ball. The ball is unanchored and responding to Explosion forces near by. So it will move. But so far your suggestion does not seem to be working.

Are you sure that both the ball and the part are server-sided or client-sided? That’s the only thing I can think of, they won’t work if one is client side and the other is server side.

The part that is meant to me touching the ball to make it move cannot be anchored

And he isn’t wrong it has to be on the server not the client