I’ve been working on this Penguin game for some time, and I keep running into the same issue. The penguin movement and physical size increases and decreases are handled on the client. The issue is simple. After selling, which looks like this, which usually tweens nicely, however I removed it thinking it would solve my issue, the penguin behaves oddly, and wants to fall though the map. Here is what that looks like. The penguin is moved with a simple body velocity. This is what that function looks like that. If anyone could figure this out for me, i’ve been spending too much time trying to figure it out. Thanks!
If the part cannot exert any force on the Y axis to counteract gravity, then your penguin will fall down, assuming it is not colliding with a floor, or the penguin has CanCollide set to false
The BasePlate is the floor. The penguins CanCollide is never changed. What Vector3 should I use to counteract the gravity? I want the ball to roll behind the player, not float.
So your penguin has CanCollide set to true, and there is a proper floor? If this is all true then I cannot think of any reason why your penguin is falling through the map.
What do you mean correctly attached to it’s moving part? I generate an adjusted position, which is always behind the player. I then set the Velocity of the BodyVelocity to (adjustedPos - currentPos).unit*speed. This glitch only happens after the ball mass is sold. That process goes like this.
Ball Touches SellPart;
Server is invoked, server changes leaderstats after running checks;
A true boolean is returned to the client;
The client anchors the ball, and removes all active forces (Vector3.new(0,0,0))
The client tweens the size of the ball to Vector3.new(2,2,2)
The client waits .5 seconds after the tween is completed, then un-anchors the ball;
If the ball size is 25,25,25, the ball falls a great distance, and slips right through the baseplate;
If the ball size is small, the ball seems fine, but upon collection fish, the ball seems to want to fall under the map.
The collection of the fish un-anchors and Disables Collision for the fish so it falls through the map. The ball syncs with that fall.
The size changing is only happening on the client, as well as removing all active forces.
I may be wrong, but some of these operations you are performing on the client might not be replicating to the server, causing discrepancies and ultimately the server overriding your client changes and making you fall through the map.
Try doing the same steps but executed from the server, and see if you encounter the same problems.
What if you used a BodyPosition, with the BodyMaxForce Set to the same (inf,0,inf)
It would take a little bit of adaptation, but it would allow you to make the movement look smooth and exponential.
Once you size the ball and anchor it on the client, move the ball’s position to its Position.Y + its Size.Y/2 to make it perfectly sitting on the surface of your floor, which would prevent it from clipping through the floor like @PlantChampion said.