• Timer Failed !
    3 replies, posted
Hello guys how can i spawn a entity realivte to a entity ?
Post your code and the error?
You can use: NewEntity:SetPos( FirstEntity:LocalToWorld( Vector( 0, 0, 100 ) ); which will set NewEntity 100 units above FirstEntity. If you want relative based on direction, look into Normalized Vectors. They're unit length 1 and describe a direction. If you multiply a normalized vector by x, then you follow the direction described by the normalized vector and stop x units along the "path". So, to move an entity 100 units in the following directions ( in order )... Forward, Backward, Right, Left, Up, Down NewEntity:SetPos( FirstEntity:LocalToWorld( FirstEntity:GetAngles( ):Forward( ) * 100 ); // 100 units forward of first entity NewEntity:SetPos( FirstEntity:LocalToWorld( FirstEntity:GetAngles( ):Forward( ) * -100 ); // 100 units behind of first entity NewEntity:SetPos( FirstEntity:LocalToWorld( FirstEntity:GetAngles( ):Right( ) * 100 ); // 100 units to the right of first entity NewEntity:SetPos( FirstEntity:LocalToWorld( FirstEntity:GetAngles( ):Right( ) * -100 ); // 100 units to the left of first entity NewEntity:SetPos( FirstEntity:LocalToWorld( FirstEntity:GetAngles( ):Up( ) * 100 ); // 100 units above the first entity NewEntity:SetPos( FirstEntity:LocalToWorld( FirstEntity:GetAngles( ):Up( ) * -100 ); // 100 units below the first entity
Ok thanks ! Bump please.
Sorry, you need to Log In to post a reply to this thread.