• Make Player Not Collide With World
    2 replies, posted
I'm trying to make players only collide with props and ignore the world whilst keeping engine movement physics, so I'd rather not use something like GM:Move. I tried using SetCollisionGroup, but couldn't get it to work on a player. I couldn't get ShouldCollide to prevent map collisions with players. Setting the player's PhysObj EnableCollisions to false only prevented them from pushing props around. PhysicsDestroy had the same result as EnableCollisions. constraint.NoCollide(PLY,Entity(0)) failed/returned false. SetSolid(SOLID_NONE) didn't seem to do anything. PhysicsInit(SOLID_NONE) didn't work. PLY:SetOwner(Entity(0)) and vice versa did nothing Anyone know how to accomplish this or something similar to it?
The only way I can think of doing this is with MOVETYPE_NOCLIP. though, that will allow you to move in any direction so you might want to use some math to fix that. Edit: Maybe try MOVETYPE_FLYGRAVITY or some of the other [URL="https://wiki.garrysmod.com/page/Enums/MOVETYPE"]Movetype enumerations[/URL]
from what I've tried, you genuinely do have to override GM:Move. Even hooks like ShouldCollide still don't allow you to disable world collision. Player movement is ingrained deep in how the physics works, as far as I know. Luckily for you, the code for how players move and how walk sounds are calculated are available at [URL]https://github.com/ValveSoftware/source-sdk-2013[/URL] if you find the right files. All you need to do is replicate the calculations in GM:Move
Sorry, you need to Log In to post a reply to this thread.