Spawn entity : Walls

Hi,

I have a problem when spawning a special entity (a 3d model spawned using a button)
If you look about a wall (while clicking on the button), it spawn behind the wall in void and then fall

so, how do fix that please ?

hi i want help with this problem and i want you people to find the problem with magics and without any code


	local test = ents.Create('blabla')
	test:SetPos(ply:GetPos()+ply:GetForward()*30+Vector(0,0,20))
	test:SetAngles(ply:GetAngles())
	test:Spawn()
	test.ply = ply
	

This line make the ent spawn at a position in front of the player. You should ray trace from the player in the forward direction so you can set the position somewhere inside the map.

This might also be useful if you go a different route.

Thanks you so much ! It worked !
Solved problem :slight_smile:
Didn’t knew there was a function like that!