• Stupid questions regarding vectors
    1 replies, posted
I am trying to make a script that will spawn 7 explosive barrels where you aim lined up side by side left to right. However I cannot seem to figure out what vector coordinates I need to put to achieve this, here is the code I am trying to fix: [CODE]stuff[x]:SetPos( Entity(1):EyePos() + ( Entity(1):GetAimVector() * 16))[/CODE]
It'd make sense if you do it this way: [code] for i = -3, 3 do ... desired_pos = center + player_eye_angles:Right( ) * spread * i stuff[ i ]:SetPos( desired_pos ) .. end[/code] Of course it doesn't account for things like spawning them in the world or inside other props, but that is the gist of it.
Sorry, you need to Log In to post a reply to this thread.