Prop Ghosting

With Garry’s Mod, I like to create poses using ragdolls. The one thing that really annoys me is that sometimes the shoddy structure of a ragdoll might end with me accidentally messing up a certain part of the pose with the physgun. It is also difficult to create a pose inside a vehicle. Is there anything I can use that will make a certain prop ignore the physgun until I want to tweak it/finish it for screenshots?

Weld it to the world and then use reload on it with the weld tool when you’re done?

I mean so that it acts as a no-collide, except the physgun doesn’t ‘grab’ onto it (aka: If you used it, the physgun would still travel in a straight path without grabbing the car at all, even if you aimed straight at it).

I think if you set what ever prop’s owner to you using SetOwner, you won’t be able to phys gun it.

Wrote this up on the spot for you (Untested)

[lua]

concommand.Add(“propghost”, function(ply)
if !IsValid(ply) || !IsValid(ply:GetEyeTrace().Entity) then return end
ply.GetEyeTrace().Entity.ghosted = true
ply:ChatPrint(“Ghosted: “…ply:GetEyeTrace().Entity:GetClass()…” (”…ply:GetEyeTrace().Entity:GetModel()…")")
end)

concommand.Add(“unpropghost”, function(ply)
if !IsValid(ply) || !IsValid(ply:GetEyeTrace().Entity) then return end
ply:GetEyeTrace().Entity.ghosted = false
ply:ChatPrint(“UnGhosted: “…ply:GetEyeTrace().Entity:GetClass()…” (”…ply:GetEyeTrace().Entity:GetModel()…")")
end)

hook.Add(“PhysgunPickup”, “propghost”, function(ply,ent)
if !IsValid(ply) || !IsValid(ent) then return end
if ply:GetEyeTrace().Entity.ghosted then return false end
end)

[/lua]

It didn’t work, but I have a feeling now that it is because of line 3, where you put a . rather than a :

It’s working, sorta. It displays that the prop has been ghosted, but it doesn’t actually ghost it :suicide:

As I was saying.

[lua]
concommand.Add(“propghost”, function(ply)
if !IsValid(ply) || !IsValid(ply:GetEyeTrace().Entity) then return end
ply:GetEyeTrace().Entity:SetOwner(ply)
ply:ChatPrint(“Ghosted: “…ply:GetEyeTrace().Entity:GetClass()…” (”…ply:GetEyeTrace().Entity:GetModel()…")")
end)

concommand.Add(“unpropghost”, function(ply)
if !IsValid(ply) || !IsValid(ply:GetEyeTrace().Entity) then return end
ply:GetEyeTrace().Entity:SetOwner(null)
ply:ChatPrint(“UnGhosted: “…ply:GetEyeTrace().Entity:GetClass()…” (”…ply:GetEyeTrace().Entity:GetModel()…")")
end)
[/lua]

On line 3, you put a . before GetEyeTrace and not a :

Thanks. This one works. :rock: