Announcement

Collapse
No announcement yet.

Input Action setup works in Character BP but not in Player Controller

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

    Input Action setup works in Character BP but not in Player Controller

    The exact same setup works in the Character BP, ofc there I dont need to cast. My guess is that i need somekind of a "Add Input..." function node, like what I had to use for the Jump. But there is no Shoot function, only the input event.

    Click image for larger version

Name:	why.png
Views:	1
Size:	518.0 KB
ID:	1160606

    #2
    There's a ton of duplicated logic in there. At what point is it not working? Have you ensured InputActionShoot is called on press/release? Double checked your input mapping?

    I can't see what you are getting the world location of, but make sure the transform is accurate with a debug sphere, etc.

    Comment


      #3
      Originally posted by ilkhan View Post
      There's a ton of duplicated logic in there. At what point is it not working? Have you ensured InputActionShoot is called on press/release? Double checked your input mapping?

      I can't see what you are getting the world location of, but make sure the transform is accurate with a debug sphere, etc.
      The duplicated logic is to lock down the directions where the players projectile can spawn. The world location is of an arrow component of the character. I got it to work, after I did the whole thing again from scratch. Strange.

      Comment


        #4
        Originally posted by Croatoan View Post
        The duplicated logic is to lock down the directions where the players projectile can spawn. The world location is of an arrow component of the character. I got it to work, after I did the whole thing again from scratch. Strange.
        That's nice to hear. May i give you an advice for your way of building code? This only seems to happen in Blueprints it seems. People are not using variables to save certain values and reuse them.

        Try to save the Actor Location etc to variables. Also think about making this whole code thing into a Function, so that you can use Local Variables.
        This will make the whole Blueprint cleaner and easier to read! You may also want to try to use "REROUTE" nodes. They let you redefine the way of a wire.
        From 4.8 on, you can double click a wire to spawn such a reroute node. In 4.7 you need to search for it with the dragged wire like for other nodes.
        Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

        My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
        (Including 100+ Pages Multiplayer Network Compendium to get you started.)

        Comment


          #5
          Originally posted by eXi View Post
          That's nice to hear. May i give you an advice for your way of building code? This only seems to happen in Blueprints it seems. People are not using variables to save certain values and reuse them.

          Try to save the Actor Location etc to variables. Also think about making this whole code thing into a Function, so that you can use Local Variables.
          This will make the whole Blueprint cleaner and easier to read! You may also want to try to use "REROUTE" nodes. They let you redefine the way of a wire.
          From 4.8 on, you can double click a wire to spawn such a reroute node. In 4.7 you need to search for it with the dragged wire like for other nodes.
          Thanks for the tips! I did not know about the reroute nodes, they are useful indeed.

          Comment

          Working...
          X