1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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.

vectors, rotators what so ever; I need help

Discussion in 'Programming' started by 2COOL4-U, Nov 6, 2001.

  1. 2COOL4-U

    2COOL4-U New Member

    Joined:
    Mar 17, 2001
    Messages:
    505
    Likes Received:
    0
    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?
     
  2. Magus

    Magus New Member

    Joined:
    Oct 7, 2001
    Messages:
    69
    Likes Received:
    0
    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
    }
    }
     
  3. 2COOL4-U

    2COOL4-U New Member

    Joined:
    Mar 17, 2001
    Messages:
    505
    Likes Received:
    0
    HitLocation+HitNormal*8,AimRotation

    What do the hitlocation and hitnormal vector store and what's the restult when you add them?
     
  4. Magus

    Magus New Member

    Joined:
    Oct 7, 2001
    Messages:
    69
    Likes Received:
    0
    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
     

Share This Page