• constraint.Rope to LocalPlayer()?
    4 replies, posted
Can you constrain a player with a rope to a wall? Or more specifically a winch? e.g. constraint.Rope(LocalPlayer(), can, LocalPlayer():GetPos(), can:GetPos()... etc. etc. print(IsEntity(LocalPlayer()) -- prints true I'm trying to build a grappling hook that follows normal physics (unlike the rest of the ones I could find) Right now I'm spawning an invisible can in front of me, parenting the player to it, constraining the can to the trace and then updating the players position relative to the can (using code in shared.lua... similar to player weld)...
constraint.Rope is serverside and LocalPlayer() is clientside, use pl or ply instead
[QUOTE=slay3r36;22600089]constraint.Rope is serverside and LocalPlayer() is clientside, use pl or ply instead[/QUOTE] Players aren't exactly physically simulated, so you can't really constrain them. pl and ply are naming conventions for variables which contain a player, please check your facts before posting shit like that. What do you need this for? [editline]02:30PM[/editline] Oh, right a grappling hook. Except, you know, you can't make it follow "normal physics", because again, players are not physically simulated. The only physics they have is a physics shadow for pushing props around when you run into them, but you can't use it to actually move the player.
[QUOTE=_Kilburn;22601287]Oh, right a grappling hook. Except, you know, you can't make it follow "normal physics", because again, players are not physically simulated. The only physics they have is a physics shadow for pushing props around when you run into them, but you can't use it to actually move the player.[/QUOTE] There used to be a SWEP from VIP Assassination or something, the Ninja Rope. It behaved quite like the one from Worms, and if memory serves, worked by parenting the player to a prop and using the prop for detection. So, in theory, you could easily get away with it by creating an SENT that does the following: Is set to their model and has its physics initialized. Has its bones set to where the player's bones are. Statued. And then just constrain to that. Parent the player to it or something, of course.
[QUOTE=_Kilburn;22601287]Players aren't exactly physically simulated, so you can't really constrain them. pl and ply are naming conventions for variables which contain a player, please check your facts before posting shit like that. [/QUOTE] Ah, I remember parenting myself to something with ent_fire but I could still walk around. Also, I know what he meant by pl and ply. [QUOTE=Kogitsune;22601613]There used to be a SWEP from VIP Assassination or something, the Ninja Rope. It behaved quite like the one from Worms, and if memory serves, worked by parenting the player to a prop and using the prop for detection. So, in theory, you could easily get away with it by creating an SENT that does the following: Is set to their model and has its physics initialized. Has its bones set to where the player's bones are. Statued. And then just constrain to that. Parent the player to it or something, of course.[/QUOTE] Downloaded the code, I watched the youtube and it's similar to what I want... between Player Weld, Grappling Hook 3.3, and Ninja Rope, I'm going to have what I want.
Sorry, you need to Log In to post a reply to this thread.