vectors, rotators what so ever; I need help

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

2COOL4-U

New Member
Mar 17, 2001
505
0
0
37
dot NL
2cool.free.fr
I am working on a special gun and I never worked with vectors before, now I want to spawn 4 acotrs that each travel in a different direction from each other with a difference of 90 degrees between two actors, so if you saw it from a top view it would look like the attachment. I spawn them in a projectile class(I want those four to appear after the projectile hit the target.) Any idea?
 

Magus

New Member
Oct 7, 2001
69
0
0
Visit site
function explode(vector HitLocation,vecote HitNormal)
{
local rotator AimRotation;
local int i;

for(i=0;i<4;i++)
{
spawn(class'WhatEverClass',,,HitLocation+HitNormal*8,AimRotation);
AimRotation.Yaw += 16384; //rotates aim 90 degrees before spawning next thing
}
}
 

Magus

New Member
Oct 7, 2001
69
0
0
Visit site
HitLocation is the vector that stores where the actors hit.
HitNormal is the direction at which the actors hit. Very useful with

HitLocation is given to you from processTouch, when the projectile hits another actor. HitNormal can be found easily by taking the Normal(HitLocation-Other.Location) in processTouch.

The result of adding two vecotrs is a vector. And by adding these two vectors it tells you the direction and stuff at which it hit, so that you can spawn the actor/effect facing the right direction and stuff.

More information about vectors and rotators check out this tutorial at Chimeric on vectors and rotators