Announcement

Collapse
No announcement yet.

Move Actor along X-Axis

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

    Move Actor along X-Axis

    Hello,
    I've been stuck on this simple problem for 2 hours now.... How do I get an actor to move along the X-axis only? I'm trying to get my object to move along that axis, but nothing is working. Any help would be much appreciated! I've googled everything I could and still got nothing.

    Thanks,
    Mike

    #2
    I am also a newbie. All I can say first you have to set input in project settings. Axis input and two button with 1 and -1 scale. Then in character blueprint, you have to add that inputaxis connected with "add movement input" and set the world direction in that. You have to tweak the world direction to get the movement along your desired axis. Hope it can help.

    Comment


      #3
      In project settings, Look under "Engine" --> "Input" --> "Bindings" --> "Axis Mappings" --> And then remove the one you don't want. MoveRight both account for right/left, and forward is forward/backward.

      Hope it helps :-)

      Comment


        #4
        I'm working with a ball and I want that ball to constantly roll a long the x axis. I've tried making the ball an actor and pawn and still can't get it to move. I tried making it like a player but still couldn't get it to move. So far, I can only get it to rotate

        Comment


          #5
          Click image for larger version

Name:	help.jpg
Views:	1
Size:	234.0 KB
ID:	1084489

          One of these setups might work depending on what you need.

          All targets should of course be your actor.

          The first one is simplest to do. Since it just moves the actor. However since it just places it, you need to set the delay timer low to make it seem smooth. Or else it will move "laggy"
          The second one is to make the ball a pawn, and assigning ai to it, and then get it to move. Here the refresh just need to happen before it reaches the destination. You need to setup movement for the ball though.
          The third setup involves a timeline, wherein you make a vector line. Leave y and constant, and set x to be the same value (not zero) all the way over. If you vary it, the ball will roll faster/slower depending on the slope on the curve. :-)
          Last edited by Fjordhoj; 08-26-2015, 05:36 AM.

          Comment


            #6
            I didn't get any of these to work The ball just sits in one position. I want the ball to constantly move along the x axis with no input. Right when the game starts, the ball starts rolling. Just like the endless runner tutorials from unreal engine, they made the player constantly run forward without pressing any buttons. I want my ball to do something like that.

            Comment


              #7


              MoveSpeed is a variable you could create. Though you don't need it, you could directly enter the X value into the + node.
              It is a "Vector + Vector" node. Rightclick one of the pins and click "Split Struct Pin" to get the 3 X,Y and Z floats like i have in the screen.
              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


                #8
                That worked! Thank you so much! For what ever reason, it wouldn't work for me the first time! Thank you! few

                Comment


                  #9
                  Originally posted by Michael Hampshire View Post
                  That worked! Thank you so much! For what ever reason, it wouldn't work for me the first time! Thank you! few
                  No problem. Just one additional note: If you hit "Sweep" at the SetActorLocation node, the pawn will be moved to that location like you were pushing it.
                  So HitCollision etc will be called. If it is not ticked, the Actor will teleport to the new position. Maybe this will be important for you in some way.
                  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


                    #10
                    A slight nitpick but one that makes it functional vs non-functional - at least from what I have experienced in 4.19... eXi's use of floats doing the vector arithmetic doesn't work for setting an actor's location except in the circumstance of the Event Tick. Vector + vector does.as posited by Fjordhoj, Though eXi's code does work for a constant moving by Event Tick which he presented above --- which is odd, but something that I've observed.Click image for larger version  Name:	vectoraddsetloc.JPG Views:	1 Size:	65.1 KB ID:	1490095
                    Last edited by RobMilliken; 06-17-2018, 01:07 AM.

                    Comment

                    Working...
                    X