I don’t use bodyvelocity, I just set the velocity of the puck to move in a direction. However, I assume it has something to do with the networkownership change, it just goes around every object it collides with and continues forward. Is there any way to prevent this? Or stop it from happening as frequently as this?
I think what you should do is check its h value (in derivative mathematics this is basically like the offset of 2 points in terms of x and y, not magnitude) then see if the sum of them is within a certain thresshold, say 5. If it is you will set its velocity to a vector3 of 0 magnitude
I have 2 scripts that constantly check in front of the part and make it slow down if it detects a part in front of it, I don’t think that would help, I think it’s a problem with networkownership because it lags it, you can even see it jitter a little on contact.
But if I were to attempt this, what would the offset be?
network ownership is designed for clients to perform computational difficult things on their computers, such as flying a plane. You would have two values, x0 and x1 where x0 is the previous position and x1 is the one at the current render step (hint, use a modulo divisible of 2)
Hmm, this might just be a case of the Roblox physics engine fart moments especially with how ice physics work, just look at games like whatever floats your boat with the moving land boats using an ice part.
Maybe a simple solution is to just make it lose velocity is to decrease the velocity when it touches a player.
--decrease current velocity by 20%
Part.Velocity *= 0.8
I attempted your code but it wouldn’t deviate at all from 0. (i took the absolute value of the number) because it runs before every physics render, I think it runs too fast to detect major deviation yet the lag puck still happens some times.
Hmm, maybe try comparing its vector to the previous vector. From there find what was the angle measure difference from these (see the law of cosines) if it is greater than say 120 we can guarantee that it had been collided with and we can then lower its velocity like @dthecoolest suggested
No, none of this worked, its doing a different version of the previous thing now. Instead of gliding along the part and then going in the same direction, it flat out teleports to another position then goes around the goalie. Has anyone ever experienced this? Any solution anywhere? I haven’t been able to find any other report of this.
I stopped using velocities and switched to bodyforce, I have 0 clue as to why this happened, it wasn’t a network ownership bug, etc. Idk if this is a roblox bug or how I executed it? But it’s fixed now.