Announcement

Collapse
No announcement yet.

Controlling an object without possession?

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

    Controlling an object without possession?

    Hey everyone,

    I am currently working on a melee beat em' up system. I have a simple lock on object that needs to rotate around the character based on the direction the joystick is pointing. Seeing as my character's punch animations use root motion, I can't simply parent the lock on object to the mesh.

    So what I need to do is make a separate blueprint that copies the location of the player mesh, and takes the input of the controller to 'orbit' around the character (mostly just the joysticks)

    How would I build a blurprint that doesn't need to be possessed to receive inputs? It wouldn't be a pawn, correct?

    #2
    You can use the Enable Input function on any actor to work something like that. Then you can just add the inputs in the actor. Using a pawn won't work in this case, I believe UnPossessed Pawns can't receive inputs.

    Comment


      #3
      I attempted to use enable input into the 'add controller yaw input' but the actor needs to be a pawn for it to work! How would I be able to map the joystick controls to this actor without possession?

      Comment


        #4
        Originally posted by spybot View Post
        I attempted to use enable input into the 'add controller yaw input' but the actor needs to be a pawn for it to work! How would I be able to map the joystick controls to this actor without possession?
        Yeah, that is not going to work. A pawn works when it's controlled by a controller. Adding controller yaw input modifies the actual controller rather than the pawn.

        An actor doesn't have a controller of any type, so you don't need to worry about modifying the controller. You just have to directly modify the actor using something like add local or relative rotation

        Comment


          #5
          I was able to get rotation information of the camera and the joystick from the player character blueprint, and I casted it to the target blueprint. I put the values through a print string to confirm that the information was casting correctly, but when I plug it into the 'set actor rotation' node with the target set to 'self', it just doesn't rotate the actor!

          Click image for larger version

Name:	image.jpg
Views:	1
Size:	155.1 KB
ID:	1065804

          Click image for larger version

Name:	shader.jpg
Views:	1
Size:	105.9 KB
ID:	1065805
          Attached Files

          Comment


            #6
            Set actor rotation rotates the sphere around its own pivot. You might want to use a dummy as root (like a billboard or scene component) and offset your ball component an appropriate distance. Make sure the ball's pivot is at your player so that it will rotate around it!

            Another option would be to create a "rotate around point" function.

            Comment


              #7
              I tried what you did, by adding a billboard, but no avail. Also, I changed the object to a cube to see if it is indeed rotating around it's own point, and it isn't either.

              Click image for larger version

Name:	2.png
Views:	1
Size:	324.5 KB
ID:	1066108

              Comment

              Working...
              X