Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Ways to prevent players from clipping through walls using animations?

Asked by 5 years ago

tl;dr how do I stop players from clipping through walls with animations

There's this really common glitch where a game might have, say, a crawling system, and players use that system to glitch through walls by spamming the crawl button to play the animation. In my case, I'm just trying to find a way to stop players from clipping through walls by abusing animations. I have an emote system that has a particular emote where the player keels over and dies. Problem is, I've seen people using this to clip through walls extremely easily.

So far, I've implemented a function that detects when a player's torso or head is touched by a part, and if the animation is playing when it touched that part, stop the animation. This has helped somewhat, but doesn't completely stop part clipping. I've tried teleporting players' characters a few studs back using the torso's lookvector, but that made it easier to clip through walls if you turned around and put your back against it. I tried teleporting the character torsos to the last saved CFrame, but again, that didn't fully solve the problem and just caused more bugs. I considered anchoring the root part, but that could cause an entirely new problem due to the strange behavior related to anchoring the root part. I'm sort of stuck here, and I'm not sure what I should (or can) do. Any suggestions or solutions?

0
Does the character need to move? Setting WalkSpeed to 0 is another alternative to anchoring HRP. xPolarium 1388 — 5y
0
Yea, the character needs to move. Setting the walkspeed won't stop character clipping though. steven73598233 75 — 5y
0
hmm maybe by changing the character collision settings to inner box instead of outer. 129Steve129 7 — 5y

Answer this question