I'm Currently working on a NPC Trader pack and I've ran into a wall here. When the npcs spawn at their designated location they spawn in at an angle.
[B]Spawning at an Angle:[/B]
[IMG]http://i.imgur.com/tD89NDN.png[/IMG]
Here is the bit of code that is used to spawn them in.
[CODE]if ( CLIENT ) then return end
local hnpc_pos = Vector(-1199.025879, 1661.993774, 49.031250)
local hnpc_ang = Angle(3.035999, 0.617960, 0.000000)
hook.Add( "InitPostEntity", "healnpc_spawn", function()
local healnpc = ents.Create( "heal_npc" )
healnpc:SetPos( hnpc_pos )
healnpc:SetAngles( hnpc_ang )
healnpc:Spawn()
healnpc:DropToFloor()
end)
[/CODE]
Why would they be spawning in like this?
I don't know which way is forward on a model (I assume +X?), but try changing all of your angles in hnpc_ang to 0.
Angle(3.035999, 0.617960, 0.000000)
Because the pitch that you selected shouldn't be used on entities as SetAngles, anyway, just use an Angle 0 for everything, and if you need to move the npc's head just use poseparameters
Ah sweet, thanks guys. That worked.
Sorry, you need to Log In to post a reply to this thread.