Results 1 to 3 of 3
  1. #1
    MSgt. Shooter Person
    Join Date
    Jan 2004
    Posts
    221

    Default the movement of an arrow

    Hi. I am making a crossbow and other arrow stuff.

    I have my arrow projectile. It flies through the air like an arrow apart from the fact that its rotation doesnt change while it is moving.

    I thought a good way to solve this problem would be to use the last location and current location variables.

    so basically i have a 3d line in space, from vector A to vector B and i want to find out which way this 3d line is pointing in terms of pitch, yaw and roll.

    Can anyone help me?

    can i use this native function at all?
    function rotator OrthoRotation( vector X, vector Y, vector Z );

  2. #2
    MSgt. Shooter Person
    Join Date
    Jan 2004
    Posts
    391

    Default

    Vector B - Vector A will give you a vector for the line of fire.
    To get this as a direction you need to normalise it (turns it into a unit vector, a vector with a magnitude of one). From that you can turn it into a rotator.

    here is how it would look in code:

    local vector A,B;
    local rotator rot;

    rot=Rotator(normalize(B-A));

  3. #3
    MSgt. Shooter Person
    Join Date
    Jan 2004
    Posts
    221

    Default

    thankyou. I knew it was something along those lines.
    I have quite a cool arrow now which moves nicely and sticks in walls.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.