View Single Post
Vasto_Lorde
Junior Member
Join Date: Oct 2016
Old 09-17-2017 , 15:37   Re: [CSGO] Force Velocity on Entity
Reply With Quote #6

Quote:
Originally Posted by Rachnus View Post
Try spawn a prop that works with prop_physics like a dropped C4 and make it invisible, then parent your ghoul prop onto the C4 and teleport your C4 instead of your ghoul, this is what I do here:

https://github.com/Rachnus/SuperHero...jgohan.sp#L212

I create a prop_physics with the model "models/weapons/w_ied_dropped.mdl" then parent the env_sprite to it. And the result looks like this:

https://www.youtube.com/watch?v=HKy_1t4fp_Q
Dude you are my master. The movement works fine. But other problems occured:
1. There is a sound of C4 "moving"
2. When they fall from the edge there is a chance they flip over so we can see only feet of ghouls
3. Now my angleEntity function doesnt work, tried it on ghoul and C4 parent(and both), no results. I
Code:
stock void AngleEntity(int ent, int ent2){
	float angle[3];
	float position[3];
	float position2[3];
	GetEntPropVector(ent, Prop_Send, "m_angRotation", angle);
	GetEntPropVector(ent, Prop_Send, "m_vecOrigin", position);
	GetEntPropVector(ent2, Prop_Send, "m_vecOrigin", position2);
	
	float x = position2[0] - position[0];
	float z = position2[1] - position[1];
	float radians = ArcTangent2(z, x);
	angle[1] = radians * (180 / 3.14);
	
	SetEntPropVector(ent, Prop_Send, "m_angRotation", angle);
}
I assume that problem 1 and 2 can be solved by adding some noclip or movetype to the parent, but i dont know any DispatchKeyValue values (such as "targetname" for name)
And the problem 3 maybe could be solved by putting other model insted of C4 that can handle both angles and velocity?

I'd glady recive any kind of help from you
Vasto_Lorde is offline