Announcement

Collapse
No announcement yet.

Using player input on non playerController actors

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

    Using player input on non playerController actors

    I'm trying to move an actor that isn't connected to the player controller, I'm not sure what I'm doing wrong here's my code:Click image for larger version  Name:	devenv_DdRDjbC4sU.png Views:	0 Size:	34.2 KB ID:	1729823
    I think my main issue is that I'm using <this> on a non playerController actor but I'm not sure how else I'd get the actor into the input stack, I've got the input set up on the project settings as right click triggering Move1. Should I instead have the bind set up with the rest of them in the main possessed pawn and get it to send a signal to this actor or should I stick to this? I've checked online for a while but I cant find anything relating to non playerController set ups so I think thats whats getting me stuck.

    please help!

    thank you
    Last edited by WillowRo; 03-06-2020, 03:04 PM.

    #2
    Hello,

    Have you encountered this ancient thread?
    https://forums.unrealengine.com/deve...n-custom-actor

    Comment


      #3
      Originally posted by Kontur View Post
      Hello,

      Have you encountered this ancient thread?
      https://forums.unrealengine.com/deve...n-custom-actor
      thanks for responding!

      no, I've never seen this before, all my research was based around "taking input" rather than setting up binds so i guess that's why,
      From looking at this, being completely honest I don't understand it much but i think i get his issue is that he was calling EnableInput and it was getting cleared early because he was calling it at the wrong time so he fixed it by calling it after he'd set up the InputComponents, I've tried this and I'm still getting errors, i'm wondering if this is outdated? Also he uses PCowner which I don't know if I can use for my situation, I'm not really sure

      Looking at the code for the default 3rd person character they don't use EnableInput at all in any of their code is there a newer way of doing this that I should look into?

      Comment


        #4
        Okay, looking through an old post where a unreal engine developer talks about the player controller, they say you can only have one player controller control one pawn at a time, so i guess my options are:

        -take input without a player controller
        -make another controller and make them both work simultaneously

        are either of these possible?

        Here's the post I found for future people that might wonder on this

        Comment


          #5
          Taking input without a player controller would certainly help you. A raw input generated by the system itself and which follows the constraints set on it.
          Have you tried it?

          Comment


            #6
            Easy way:

            - have ptr to "other object current being controlled" in player controller (looks like you have that)
            - in the player controller input handlers redirect the input when necessary

            I've done this on a few projects. Another nice thing you can do is make an interface for controlled objects. That way any object that the player can control with input handles MoveLeft() or MoveUp() or whatever ...

            Comment


              #7
              Originally posted by RuskinF01 View Post
              Taking input without a player controller would certainly help you. A raw input generated by the system itself and which follows the constraints set on it.
              Have you tried it?
              would you suggest doing that just like you normally would in c++?

              Comment


                #8
                Originally posted by Shmoopy1701 View Post
                Easy way:

                - have ptr to "other object current being controlled" in player controller (looks like you have that)
                - in the player controller input handlers redirect the input when necessary

                I've done this on a few projects. Another nice thing you can do is make an interface for controlled objects. That way any object that the player can control with input handles MoveLeft() or MoveUp() or whatever ...
                oh nice, i'll try it
                thank you!

                Comment

                Working...
                X