Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

No player pitch rotation accesible in Kismet.

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

  • No player pitch rotation accesible in Kismet.

    Hello,
    I ran into a problem which I believe can only be solved with programming... so I need your help there.
    Basicaly only the rotation from left to right and back can be accessed in Kismet. However the Up and Down rotation is always 0!!!
    This video shows the problem better than anything else:

    The variables shown are from a Get Actor Rotation Vector output which I converted to a String and sent to Log. I guess those huge Y numbers are normal as the numbers are in degrees when I start the game but multiplied once I move the mouse.
    As you can see the arms which are a skeletal mesh attatched to the player rotate to the side just fine but refuse to go up or down with the camera. Which is pretty much as expected given that the Pitch rotation of the player is always 0! So how can I make the pitch rotation accesible and solve this?
    The only hint I could find at how to solve this was: " look for the UpdateRotation function in either your pawn or controller class... i think it zeros out the pitch by default."
    from http://forums.epicgames.com/threads/...-person-camera
    I followed the advice and searched for that in the SimplePawn.UC as well as SimplePC which my game is based on... but I could only find UpdateRotation a few times and to my untrained eyes it did not seem to zero out anything.
    So I have no clue how to solve this game breaking "bug".
    I know that skeletal meshes can be attatched to the player in code. However if at all possible I would prefer a solution (code change) that lets me read the player pitch in Kismet.
    Oh and I pretty much can't finish my demo/game without that pitch working... no pressure.

  • #2
    Use this node:

    Code:
    class SeqAct_GetPlayerRnL extends SequenceAction;
    
    var vector rotationVector;
    var vector locationVector;
    
    // Events
    //====================================================
    
    event Activated()
    {
    	local SeqVar_Object ObjVar;
    	local Pawn player;
    	local Rotator viewRotation;
    
    	foreach LinkedVariables(class'SeqVar_Object', ObjVar, "Target")
    	{
    		player = Pawn(ObjVar.GetObjectValue());
    		
    		viewRotation = player.GetViewRotation();
    		locationVector = player.GetPawnViewLocation();
    
    		rotationVector.X = viewRotation.Pitch;
    		rotationVector.Y = viewRotation.Yaw;
    		rotationVector.Z = viewRotation.Roll;
    	}
    }
    
    //====================================================
    
    DefaultProperties
    {
    	bCallHandler=false
    
    	ObjName="Get Player Rotation and Location"
    	ObjCategory="Player"
    
    	VariableLinks(1)=(ExpectedType=class'SeqVar_Vector',LinkDesc="Rotation Vector",bWriteable=true,PropertyName=rotationVector)
    	VariableLinks(2)=(ExpectedType=class'SeqVar_Vector',LinkDesc="Location Vector",bWriteable=true,PropertyName=locationVector)
    }
    Original Thread

    Comment


    • #3
      Thanks for your suggestion RNG. I tried your custom Kismet node and when I log its rotation output Z still stays 0 all the time. The numbers are different, but it's essentially the same situation as with the original Get Actor Rotation Vector output. Mind you in the video I had the wrong output node selected but with "Rotation Vector" I also get outputs from X&Y just like your node.
      So long story short: The Z ouput in Kismet is still 0 all the time even with your node in place. So I hope someone knows how to stop UDK from only sending 0 to Kismet for the player pitch.

      Oh and when I restarted UDK with that node still in the level my NVIDIA driver crashed and burned to bluescreen. o,0

      Comment


      • #4
        The pitch of the player is controller by the animation tree and native code.
        Unless you develop your own that is.
        Search for aimnode, aiming etc.
        Quite a few posts go into some detail about it.

        You will most likely have to create some custom code though.

        Comment


        • #5
          I just got my player killed by accident. Once dead the Z values are sent to Kismet correctly all the time untill you respawn!! Are you sure there is no line of code that can just be changed/removed to keep the Z Value from being zeroed out while the player is alive?!? It seems to me that the camera breathing breaks the Z values as they work once it is deactivated.
          I am using a clean installation of the November version and a SimpleGame type so I believe there is no Animation Tree for my player and atm I have no use for one.

          Comment


          • #6
            There is probably something wrong with your kismet node setup. I tried the custom node I linked earlier and it works both in 2012-07 and 2012-11 versions.

            Here is the basic setup for it to work: (Edit: You don't need to plug the player variable into instigator slot, just saw it after I uploaded the pics)



            Result:




            I'm guessing you have used an object variable rather than a player variable. I did mention (in the original thread) to use a player variable otherwise it wouldn't work.

            Comment


            • #7
              Originally posted by RNG View Post
              There is probably something wrong with your kismet node setup. I tried the custom node I linked earlier and it works both in 2012-07 and 2012-11 versions.

              Here is the basic setup for it to work: (Edit: You don't need to plug the player variable into instigator slot, just saw it after I uploaded the pics)
              This is my setup atm. I had the default node replaced with your Get Player Rotation one:
              Click image for larger version

Name:	rotationsetup.jpg
Views:	1
Size:	94.1 KB
ID:	3249741

              The Z rotation was still shown as 0 at all times.

              Comment


              • #8
                I thought you asked for the mesh to follow up and down axis, that is why I posted the kismet node. If you use it and set the rotation of an object with it, it'll act correctly. Z rotation is 0 because the source of it is a Rotator, which uses it for the roll. Pitch is X, Yaw is Y, Z is Roll. It works with Set Location and Rotation node because the expected rotation input is also a Rotator.

                You see changes to Z axis when you die because camera literally rolls as a death animation.

                Comment


                • #9
                  Well here comes another video this time with RNGs custom Node:

                  You can check my Kismet setup at the end of the video as well. I had to reduce the delay to 0.01 as 0.1 made the movement lag/jitter for the arms unbearable. lol
                  Well as you can see it's not working out too well even with the 0.01 delay. I would still much prefer a solution that just hard attatches the arms to the player and takes the players pitch into account.
                  If there is no such solution... how do I get the new arms setup to behave like the player attatched wand you can see in the video? (+Pitch rotation duh)

                  Comment


                  • #10
                    XilenceX, what PhysicsType is your pawn using?, A guess would be it's probably using phys_walking because your pawn is literally walking around the level in the video, unfortunately phys_walking doesn't allow for pitching of your pawn, I think its mainly because anything thats currently walking cannot just pitch itself up/down out of nowhere, usually you would have to jump and then pitch, hence when you jump it changes to Phys_Falling and you can then pitch and lean around, you may have to change physics type to Phys_Custom or Phys_flying but would then need some extra code to make walking look more realistic, instead of floating....

                    I think SlowJusko suggested the best way by using a anim aim node that way you can just pitch certain bones and it doesn't affect the physics of the pawn?

                    Comment


                    • #11
                      Originally posted by KnightsOfMalta View Post
                      XilenceX, what PhysicsType is your pawn using?, A guess would be it's probably using phys_walking because your pawn is literally walking around the level in the video, unfortunately phys_walking doesn't allow for pitching of your pawn, I think its mainly because anything thats currently walking cannot just pitch itself up/down out of nowhere, usually you would have to jump and then pitch, hence when you jump it changes to Phys_Falling and you can then pitch and lean around, you may have to change physics type to Phys_Custom or Phys_flying but would then need some extra code to make walking look more realistic, instead of floating....

                      I think SlowJusko suggested the best way by using a anim aim node that way you can just pitch certain bones and it doesn't affect the physics of the pawn?
                      There is some code in SimplePawn.UC that suggests that the headbob is only active while Phys_walking. So yeah that's probably what it is using.
                      I tried typing fly into the console... the good news is that the attatched staff rotates somehow. The bad news is that it is in no way realistic as it seems to rotate away from where the player is looking.

                      I also looked into http://udn.epicgames.com/Three/Anima...enceBlendByAim which theoretically seems to be a solution. However in practice I could never ever get that to work with the information given there. Also no offense... but it seems kind of overkill to do something like that in order to pitch an arm mesh.

                      So far the best solution for me would be to have the mesh attatched to the player in Kismet with ONLY its location. Then use the rotation node from RNG to handle the rotation. That would be combining the best of both worlds... but sadly the Attatch to Actor Node in Kismet doesn't seem to have an option for that. -.,- Basicaly I would need something like the ignorebaserotation you get for attatching stuff in-editor.
                      I tried to do an attatch first and then use the Player Rotation node to change the rotation but that made the arms vanish.

                      Comment


                      • #12
                        I have spent a few more hours on this issue, but couldn't find a way to get this to work any better than the videos posted here. This is getting nowhere fast so tomorrow I'll only spend time on this in reaction to inputs in this thread, if there are any. Otherwise I'll get back to this at some point next week.

                        Comment

                        Working...
                        X