• Spawn an entity flat on a surface?
    5 replies, posted
I'm looking at the method from the keypad addon but i'm stuck.
Do a trace, get the hitnormal.
I did that but this is what I get. This prop is standing up. [IMG]http://i.snag.gy/E1SCe.jpg[/IMG] [CODE]ent:SetAngles(trace.HitNormal:Angle())[/CODE]
Then modify the angle, like [code] ent:SetAngles(trace.HitNormal:Angle() - Angle(90,0,0)) [/code] or something.
[QUOTE=Winter;43768149]I did that but this is what I get. This prop is standing up. [IMG]http://i.snag.gy/E1SCe.jpg[/IMG] [CODE]ent:SetAngles(trace.HitNormal:Angle())[/CODE][/QUOTE] You will need to modify the angle using :[URL="http://wiki.garrysmod.com/page/Angle/RotateAroundAxis"]RotateAroundAxis[/URL], I've never understood it enough to explain it though.
Ok thanks, that makes sense. Although the angles don't seem to change no matter what. [editline]3rd February 2014[/editline] Ok, it finally worked when I tried using a different prop. I appreciate all the support.
Sorry, you need to Log In to post a reply to this thread.