Results 1 to 3 of 3
  1. #1

    Post AddImpulse doesnt use Rotation?

    Hey.. Well in short here is the issue

    Im using AddImpulse into my pawn and the impulse vector is the one i get from a trace,Now my issue with this is that the impulse doesnt take in mind the rotation as example

    with the vector im using it makes the pawn fall forward but ONLY if i use it while im standing infront of the pawn

    if i do the same but with me standing in the pawn right he still falls backwards instead of falling based on where it got hit , im using

    Code:
    function KickTrace()
    {
    
    local Vector StartLoc2,EndLoc,HitLocation,HitNormal;
    local actor Result;
    local tfppawn hitpawn;
    local vector impulse;
    
     Pawn.Mesh.GetSocketWorldLocationAndRotation(KickSock, StartLoc2); // get start and end locations for the trace
     Pawn.Mesh.GetSocketWorldLocationAndRotation('R_JB_End', EndLoc);
     
      Result = Trace(HitLocation, HitNormal, StartLoc2, EndLoc,true,,,TRACEFLAG_Bullet);
      DrawDebugLine(StartLoc2, EndLoc,255,0,0,true);
      hitpawn = tfpPawn(result);
    
    
      
       if(Result != none )
       {
        Result.TakeDamage( 10,self,HitLocation,HitLocation,class'FFDmgType',,);
    	//Result.CollisionComponent.AddImpulse(Startloc2,HitLocation);
    	
       `log("hit actor is"$Result);
       
       }
       
       if(hitpawn != none)
       {
       impulse = HitLocation;
       impulse.X = 0;
       impulse.Y = impulse.Y  + 200; // i want the player to fall forward
       Hitpawn.Mesh.AddImpulse(Impulse,HitLocation);
       }
    }
    So if i kick the player on his back he falls forward,kick him in the left,fall forward and so on

    if im right since im using Hit Location for the impulse shouldnt it use the rotation too?
    Rising Soul Studios Main Leader
    S.U.R.V.I.V.O.R RPG Survival Game

    http://www.moddb.com/games/survivor
    http://forums.epicgames.com/showthread.php?t=819282

  2. #2
    Boomshot
    Join Date
    Aug 2011
    Posts
    2,274

    Default

    Code:
    /**
     *    Add an impulse to the physics of this PrimitiveComponent.
     *
     * Good for zero time.  One time insta burst.
     *
     *    @param    Impulse  Magnitude and direction of impulse to apply.
     *    @param    Position    Point in world space to apply impulse at. If Position is (0,0,0), impulse is applied at center of mass ie. no rotation.
     *    @param    BoneName    If a SkeletalMeshComponent, name of bone to apply impulse to.
     *    @param    bVelChange    If true, the Strength is taken as a change in velocity instead of an impulse (ie. mass will have no affect).
     */
    native final function AddImpulse(vector Impulse, optional vector Position, optional name BoneName, optional bool bVelChange);
    The first parameter, Impulse, has nothing to do with position. It's a vector for strength and direction. So if you want the pawn to fall 'forward' in terms of it's rotation, with a strength of 200 then...

    Code:
    impulse = Vector(Pawn.Rotation) * 200.0;

  3. #3

    Default

    I see. Thanks spoof!
    Rising Soul Studios Main Leader
    S.U.R.V.I.V.O.R RPG Survival Game

    http://www.moddb.com/games/survivor
    http://forums.epicgames.com/showthread.php?t=819282


 

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.