Results 1 to 7 of 7
  1. #1

    Default [Solved] Top Down Shooter - Aim Up/Down help

    So, I returned to an older project of mine for a mini top down shooter arcade style game. I had left off with 'solving' the aim up down by not restricting the pawns pitch to 0 with SetRotation();

    As you can probably guess, while 'aiming up a hill' the whole Pawn rotated to suit my needs. The aiming is based on the Mouse's position on the screen, and I've been able to make it visually look like the pawn aims up properly rather than rotating the whole pawn, but when I fire the gun, it still shoots on a 0.f pitch plane.

    where can I edit this or how do I make the projectile fire in the direction the pawn seems to be aiming visually? I'll paste any code that you require to assist me, thanks in advance to anyone that tries to help.

    NOTE: I managed to make it 'look' like he's aiming by using animnodes, shooting is the problem.
    Last edited by 88Phoenix; 08-29-2012 at 05:07 PM.

  2. #2
    Skaarj
    Join Date
    Aug 2012
    Posts
    29
    Gamer IDs

    PSN ID: siimon1308

    Default

    you could download the udk platformer kit at the udn and try to modify it, that it suit for your game

  3. #3
    MSgt. Shooter Person
    Join Date
    Jun 2011
    Posts
    106

    Default

    I had to do something similar, you must implement it at the controller. GetAdjustedAimFor method.

  4. #4
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Location
    Kiev, Ukraine
    Posts
    490

    Default

    Did i understood right, your problem is, your pawn is aiming up and down when you are moving mouse up and down? If so, my method is creating custom PlayerInput class, and overriding PlayerInput event, making aLookUp var always equal to zero. Something like this

    Code:
    class MyPlayerInput extends PlayerInput
    
    event PlayerInput()
    {
         super.PlayerInput();
         aLookUp = 0;
    }
    And dont forget to set this input in your controller class.

  5. #5

    Default

    Quote Originally Posted by mrseth View Post
    I had to do something similar, you must implement it at the controller. GetAdjustedAimFor method.
    How would you do it? I overrode the UTProjectile script.

    Quote Originally Posted by lentinant View Post
    Did i understood right, your problem is, your pawn is aiming up and down when you are moving mouse up and down? If so, my method is creating custom PlayerInput class, and overriding PlayerInput event, making aLookUp var always equal to zero. Something like this

    Code:
    class MyPlayerInput extends PlayerInput
    
    event PlayerInput()
    {
         super.PlayerInput();
         aLookUp = 0;
    }
    And dont forget to set this input in your controller class.
    No, I have him aiming properly for the animation portion of it correctly, so where the Mouse is on the screen, he aims at it, but say there was a ledge, like an apartment building with a balcony, if you mouse over the balcony I wanted him to aim up at it, which he visually does now, but the shots weren't going where he was aiming, they were stuck on a 2d plane, or YAW if that helps you visualize it. I have actually solved this, I had to Modify UTProjectile.uc, by overriding it, to instead of it working off of mouse aim (FPS) and velocity, to be based on a direction, MousePosWorldLocation - Pawn.Weapon.GetMuzzleLoc() I think it was.

  6. #6
    MSgt. Shooter Person
    Join Date
    Apr 2012
    Location
    Kiev, Ukraine
    Posts
    490

    Default

    Try use GetAdjustedAimFor. Return rotator you want to use when you are shooting. If your pawn is aiming correctly, try something like this
    Code:
    function Rotator GetAdjustedAimFor( Weapon W, vector StartFireLoc)
    {
         return Pawn.Weapon.Rotation;
    }

  7. #7

    Default

    Thanks, but I had to fix the torso of my pawn from over-rotating first, but I had done the modification of the projectile anyway, they both work the same though, I'll use that method next time though, less hacky :P


 

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.