Swimming makes players fly

My guess is that some variable or function that should be private is set to public which makes it shared between all instances. The class being public is expected, but if you’ve got multiple instances of that class in your game at the same time pretty much all the variables in it need to be private unless it’s intended to change that property for all of them at the same time.

If it’s making them all fly, it probably ahs something to do wiht gravity (I mean when swimming you generally want to disable or maybe even invert gravity, which would make it look like he’s swimming in the water, but if applied outside of the water, would make him fly)

I would also suggest you use an interface instead of a cast to call the swimming function since it’s the sort of thing you’re likely to want to implement for many classes and not just the third person character class.