News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 6th Nov 2001, 10:35 AM   #1
2COOL4-U
Registered User
 
Join Date: Mar. 17th, 2001
Location: dot NL
Posts: 505
vectors, rotators what so ever; I need help

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?
__________________
Jeroen "2COOL4-U" de Haas
2COOL4-U is offline   Reply With Quote
Old 6th Nov 2001, 11:11 AM   #2
Magus
Registered User
 
Join Date: Oct. 7th, 2001
Posts: 69
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 is offline   Reply With Quote
Old 6th Nov 2001, 01:54 PM   #3
2COOL4-U
Registered User
 
Join Date: Mar. 17th, 2001
Location: dot NL
Posts: 505
HitLocation+HitNormal*8,AimRotation

What do the hitlocation and hitnormal vector store and what's the restult when you add them?
__________________
Jeroen "2COOL4-U" de Haas
2COOL4-U is offline   Reply With Quote
Old 6th Nov 2001, 04:31 PM   #4
Magus
Registered User
 
Join Date: Oct. 7th, 2001
Posts: 69
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
Magus is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:49 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer