[B]How do I nocollide a player with the world?[/B]
I can make props/entities nocollide with the world, but this does not work with the player.
Been trying to figure this out, but the functions that I have tried do not work.
I do [U]not[/U] want the player to be in movetype noclip. I want them to be in free-fall or to be floating through the map.
Do you mean so that the player doesn't collide with objects?
[CODE]
local function spawn( ply )
ply:SetMoveType(MOVETYPE_NOCLIP)
end
hook.Add( "PlayerSpawn", "Noclip", spawn )
[/CODE]
There are other things that you can do instead of a hook, but you basically need to set the MoveType of the player, if you've tried this, leave some code about how you went about trying it.
[QUOTE=Gl1tch3t;52338579]Do you mean so that the player doesn't collide with objects?
[CODE]
local function spawn( ply )
ply:SetMoveType(MOVETYPE_NOCLIP)
end
hook.Add( "PlayerSpawn", "Noclip", spawn )
[/CODE]
There are other things that you can do instead of a hook, but you basically need to set the MoveType of the player, if you've tried this, leave some code about how you went about trying it.[/QUOTE]
Well, not precisely what I was looking for, but it will help people who have a similar issue.
I managed to resolve the issue but in a different way that did not involve noclip; it is not applicable to this thread.
EDIT:
Read comment below.
Had to mark this as un-solved since this did not resolve the issue.
To be clear, I am looking for a way to make [B]players[/B] nocollided just like props are using a SWEP like Nocollide World. I want the players to be in free-fall through the map or for them to be drifting through it. I do [U]not[/U] want the player to be in movetype noclip since this does not work with what I am attempting to do.
You're [URL="http://xyproblem.info/"]XY Problem[/URL]-ing very hard. What are you trying to do?
[QUOTE=LegoGuy;52351499]You're [URL="http://xyproblem.info/"]XY Problem[/URL]-ing very hard. What are you trying to do?[/QUOTE]
I am trying to fix the portal gun so that when the person goes through it, there is no sharp stop.
When you go through a portal with the portal gun, you are teleported using SetPos, and the velocity is set using SetVelocity. The problem is that there is a sharp stop since the velocity is not adjusted properly due to the collisions of hitting the wall outside the other portal.
I would like to be able to make the player not collide with the world so that they may fall through without stopping for a split second.
You don't want the player go trhough the world, you want to move the player trhough the world, you might try to take a look at noclip movement or even simulate physics by yourself, but this is not something that "Player falls trhough the world"
[QUOTE=gonzalolog;52355152]You don't want the player go trhough the world, you want to move the player trhough the world, you might try to take a look at noclip movement or even simulate physics by yourself, but this is not something that "Player falls trhough the world"[/QUOTE]
I have tried noclip; however, the issue is that when the player is in movetype noclip, there is no gravity. I understand that simulating physics would work, as well, but this might prove to be more difficult.
Allowing the player to fall through the world would make it easier since that's how the portal gun works for props and the props go through it correctly. The missing key is the player falling through the world. Of course, I don't mean that they'll be literally falling through the world, they will be teleported while their velocity will be conserved using SetVelocity.
Not that it'd be something you can do very easily, but go take a look at what Dr Matt did with his addons. Go look at his Tardis Rewrite, Safespace and Doors addons which may give you an idea.
EDIT: There is already a portal gun addon that does this btw, just look up Aperture Science Handheld Portal Device on workshop.
[QUOTE=dgrawns;52355439]Not that it'd be something you can do very easily, but go take a look at what Dr Matt did with his addons. Go look at his Tardis Rewrite, Safespace and Doors addons which may give you an idea.
EDIT: There is already a portal gun addon that does this btw, just look up Aperture Science Handheld Portal Device on workshop.[/QUOTE]
Cool! I'll take a look!
Thanks!
[QUOTE=CryptAlchemy;52355112]I am trying to fix the portal gun so that when the person goes through it, there is no sharp stop.
When you go through a portal with the portal gun, you are teleported using SetPos, and the velocity is set using SetVelocity. The problem is that there is a sharp stop since the velocity is not adjusted properly due to the collisions of hitting the wall outside the other portal.
I would like to be able to make the player not collide with the world so that they may fall through without stopping for a split second.[/QUOTE]
I fail to see what the problem is.
Are you saying SetVelocity is setting your velocity to 0 because you hit the wall? Because that could be very easily fixed without messing around with collisions at all. It's as simple as moving the portal 1 unit away from the wall so you hit the portal before the wall
[QUOTE=JasonMan34;52358120]It's as simple as moving the portal 1 unit away from the wall so you hit the portal before the wall[/QUOTE]
Good idea, I will give this a shot. Thank you.
Sorry, you need to Log In to post a reply to this thread.