View Single Post
Author Message
Johnny2525
Junior Member
Join Date: May 2015
Old 05-27-2021 , 14:26   prop_dynamic collison not rotating?
Reply With Quote #1

Hi

So basically when I am teleporting newly created prop_dynamic object I am also rotating it, the model seems to be rotated but the model collision stays at angle 0 so it creates that "invisible wall" effect while the model is actually rotated.

Code:
wallModel = "models/props/hr_massive/wood_fence/wood_fence_128.mdl"

Ent = CreateEntityByName("prop_dynamic_override"); 
if(Ent != -1) {
	pos[0] = pos[0] + (fForward[0] * 107.0);
	pos[1] = pos[1] + (fForward[1] * 107.0);
	pos[2] = pos[2] + (fForward[2] * 107.0);

	DispatchKeyValue(Ent, "model", wallModel);
	DispatchKeyValue(Ent, "solid", "2");
	DispatchSpawn(Ent);

	float objAngles[3];
	objAngles[0] = 0.0;
	objAngles[1] = 0.0;
	objAngles[2] = 0.0;

	objAngles[1] = 90.0;
		
	
	//SetEntPropVector(Ent, Prop_Send, "m_angRotation", objAngles);
	TeleportEntity(Ent, pos, objAngles, NULL_VECTOR);
	
	SetEntityRenderMode(Ent, RENDER_TRANSCOLOR);
	SetEntityRenderColor(Ent, 255, 255, 255, 255);
	
	SetEntProp(Ent, Prop_Data, "m_takedamage", DAMAGE_YES, 1);
	SetEntProp(Ent, Prop_Data, "m_iHealth", 65); 
}


Does it have something to do with the model by itself?
If somebody could help me with this case

Last edited by Johnny2525; 06-03-2021 at 09:18. Reason: Solved
Johnny2525 is offline