Announcement

Collapse
No announcement yet.

Please Help Rotating Grabbed Objects

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

    Please Help Rotating Grabbed Objects

    Hello all, I have followed this tutorial https://www.youtube.com/watch?v=HnR1Gf5gXcY for grabbing an object and it works perfectly fine. I can pick up a physics object and walk around with it and drop it. But I want to be able to rotate the object around the objects Z axis while holding it. Or even better just have the physics object face the same direction the player camera faces for precise placement. Basically I have a camera on a tripod and I want to be able to pick it up and place it wherever I want. but currently the tripod will only face the direction of how it was originally placed in the editor and it cant be rotated. I've put up a shot of my BP and I'm fairly green when it comes to scripting and BPs so if anyone could put up screenshots of your solution I'd be super grateful. Thanks in advance
    Attached Files

    #2
    have you tried "set actor rotation"?
    Attached Files

    Comment


      #3
      you may want the target of set actor rotation to be self. I just looked at your stuff. if your talking about a camera on a tripod that is a separate actor than your character you may need to set up its own blueprint and do this set rotation inside of that blueprint. I would do a line trace to player from the tripod blueprint to find the world location of the player. Then I would find the look at rotation from with the tripod's get actor location as start and the target as the world location of the player character. Then I would update the actor rotation on event tick using the find look at result as the new rotation.

      Comment


        #4
        Originally posted by Damnationist View Post
        have you tried "set actor rotation"?
        what is the node that says target root component
        ​​​​​​​

        Comment


          #5
          im actually not sure why it forced that up. thats just for an example tho. I just made some variable of an object type actor which defaulted and forced the root component node since it was just some raw variable. I think when we reference an actor variable it forces us to use the root component while its a variable. im not sure why it does that. the root component would be like the root of the actor and most of the time will be its true center or its point of origin in the viewport. I think I tried to draw a line trace to it one time on a character and it went to the center of the actor. some people add a scene component to a weapon actor and call it barrel or muzzel and that scene component root is used for the start point of a bullet or line trace. a lot of things in ue4 are abstract ideas and it gets super confusing. ive only been working with ue4 for a few months so im not far from your level of knowledge. sometimes I answer my own questions by doing another tutorial and a light goes off and I realize I can apply the new thing I learned to the thing I couldn't figure out before.

          Comment


            #6
            Originally posted by Damnationist View Post
            im actually not sure why it forced that up. thats just for an example tho. I just made some variable of an object type actor which defaulted and forced the root component node since it was just some raw variable. I think when we reference an actor variable it forces us to use the root component while its a variable. im not sure why it does that. the root component would be like the root of the actor and most of the time will be its true center or its point of origin in the viewport. I think I tried to draw a line trace to it one time on a character and it went to the center of the actor. some people add a scene component to a weapon actor and call it barrel or muzzel and that scene component root is used for the start point of a bullet or line trace. a lot of things in ue4 are abstract ideas and it gets super confusing. ive only been working with ue4 for a few months so im not far from your level of knowledge. sometimes I answer my own questions by doing another tutorial and a light goes off and I realize I can apply the new thing I learned to the thing I couldn't figure out before.
            Interesting, well I tried the set actor rotation method above and it makes my camera flip out and when I pick up an object it makes it fly across the world so I'm not sure what to do

            Comment

            Working...
            X