• Custom collisions or shoothrough?
    2 replies, posted
Okay so I'm stumped here... I have a grappling hook that works like so: Player shoots, we spawn a model, parent the player to the model, constraint.Rope the model to their shoot-trace (aka a wall) The player's position is updated based on Player Weld code, and this is where my problem arises, if the object we parent the player to is a can, it will fall in the ground or go in cracks and such and the player will move through it like they are noclipping. If I change the model to a fridge (which fixes the problem), they become invincible because the bullets collide with the fridge. What I'm trying to is either 2 things, continue to keep the player colliding with the world (and mutually update with the grapple), or make the object "envelope" the player to simulate physics (but be shootthrough so the player can take damage) I can't figure out how to keep the player colliding or make the object shoothrough-able... What can I do?
All I can say, Is use a pole/harpoon pointing upright, It will be all tall as you and wont be wide enough to block shots? I know it doesn't answer your question about the code, but at least its a bodge for now while waiting for someone who knows what their talking about to post xD
I went ahead and instead of binding the player to the object I push him toward it with ply:SetLocalVelocity(), this works well and I can use a smaller object and the player collides with the world. The only problem is if the smaller object goes through areas the player can't fit it will spaz. I am thinking of doing the "mutually update" by having the object move toward the player as well. Could I possibly use an Entity physics init thingy like [b][url=http://wiki.garrysmod.com/?title=Entity.PhysicsInitSphere]Entity.PhysicsInitSphere [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] Possibly even not spawn the entity with a model. I could even go to the extreme of making my own entity PhysicsUpdate hook. I just want it to be extremely simple though. (so far I have exactly 52 lines of code for a working refridgerator-grappler lol) How does [b][url=http://wiki.garrysmod.com/?title=Entity.PhysicsInitBox]Entity.PhysicsInitBox [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] and [b][url=http://wiki.garrysmod.com/?title=Entity.PhysicsInitSphere]Entity.PhysicsInitSphere [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] work?
Sorry, you need to Log In to post a reply to this thread.