Announcement

Collapse
No announcement yet.

(help) Making a charge attack - Velocity nor Acceleration wont move my pawn

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    (help) Making a charge attack - Velocity nor Acceleration wont move my pawn

    Hi, I want to create a charge attack (run fast in a straight line hitting every thing in his way) to my pawn (bots).

    I'm extending the udk weapon class and the WeaponFiring stateto do so.
    Inside the state tick function i have this:
    if( VelocityMag <= 0.f )
    {
    VelocityMag = VSize( VelocityDir);
    }

    V = Normal(VelocityDir) * VelocityMag;

    if( bLocalRotation )
    {
    V = V >> Owner.Rotation;
    }
    Owner.Velocity = V;
    Owner.Acceleration = V/DeltaTime;
    the base for this code was the function Pawn.OnSetVelocity()


    Just for debugging I add this to my pawn class (IN pawn.tick())
    `log("Velocity"@Velocity@"- Acceleration"@Acceleration);

    this is the result:
    [0007.32] ScriptLog: Velocity 0.00,0.00,100.00 - Acceleration 0.00,0.00,6199.99

    But my pawn wont move... until I apply an external force to him.
    When I punch him, It starts to move.

    Why? What am I missing?

    Thanks

    ps:
    DefaultProperties
    VelocityDir={(X=0.f,Y=0.f,Z=1.f)}
    VelocityMag=100
    bLocalRotation=TRUE
    yap, Z axis. just for testing

    #2
    Hey why don't you think about using the option of the " root motion animation "
    Root motion animation it's cool!
    The engine moves the character through the data of the root bone, properties, and so it translates it into movement on your pawn.

    Comment


      #3
      mmmm, I managed to let my controlled player to walk straight without pressing the forward key by using Pawn.Accelleration and Playermove state. Maybe you can take a look at GamePlayerController class.

      Comment


        #4
        @Neongho
        uhm, I don't know about root motion... maybe.
        Is it easily scalable? like move "forever" until hit a wall or move 2x the normal speed?
        I will give a look. Thanks

        @Vindkald
        States! I didn't check the pawn state before applying the Velocity and Accelleration!
        Unfortunately I can't check this until Monday, either way, thank you to.

        Comment

        Working...
        X