Announcement

Collapse
No announcement yet.

Movement question

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

    Movement question

    Hello
    I'm just starting with blueprints. Have one question about movement:
    my goal is to make player move when I press mouse button on empty space, do I need some "invisible collider" to get point where to move? I looked at the template but my character not moving at all.
    here is a image of blueprint:
    Click image for larger version

Name:	Untitled.jpg
Views:	1
Size:	169.7 KB
ID:	1175075

    Thank you!

    #2
    Hey there,

    might be that you need a Navigation Mesh. I don't have a TopDown Point and Click Template downloaded right now, but
    check if the Template has a NavMesh in it's outline (you can also toggle the NavMesh visibility in the Viewport Settings at the top of the viewport).

    Otherwise the "MoveTo" function doesn't know where to move.

    Is the "MoveToHitLocation" function a custom one or does that ship with the PlayerController?

    If it's custom it would help me if you could open that up and show me (:
    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


      #3
      Hey eXi, thank you for your response! and yes you was right. but I need something different if you have time look at youtube video (this is my project on unity)https://youtu.be/Cgk2jcjdcT0

      so If you watched this video you can see that I used a half sphere to ray cast and get direction where to go. So this is my goal

      And thank you one more time!

      Comment


        #4
        I would keep track of the "Click" event of your Mouse and LineTrace in Mouse Direction.

        There is this handy node that gets you the WorldLocation and the Direction (which should be the camera view direction)
        of your mouse when clicking.



        With this you could do a normal "LineTrace" (Unity: RayTrace) of a specific range. If you hit something, you take the hit point
        for stuff. If you don't hit stuff, you just take the endpoint of the trace as world location to travel to.

        Though i have no idea how to implement your actual movement in space. Never done this.
        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
          I will try but no promise that this will work, because at this moment all this new stuff bit confusing

          Comment


            #6
            Originally posted by SWipiS View Post
            I will try but no promise that this will work, because at this moment all this new stuff bit confusing
            All cool (: take it slow. Copy over your project one by one and if you get stuck, just ask. Framework is a bit different to Unity so it's easy
            to get confused. But once you get the idea, you will copy the rest pretty fast.

            I'm actually watching Unity "tutorials" about stuff and implement them in UE4. It only takes some time to get used to it (:
            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


              #7
              yea.. and maybe can you tell me why there are no ConvertMouseToWorldSpace in my player blueprint? or maybe where to use this in player blueprint or playercontroller bp?

              Comment


                #8
                [MENTION=14476]eXi[/MENTION] is pretty awesome
                Website/Portfolio: http://www.VictorBurgosGames.com

                Join me on stream: https://www.twitch.tv/BurgosGames for UE4 Game Dev. If you need help, just stop by and ask!

                Wishlist Neko Ghost, Jump! a 2D/3D Puzzle-Platformer : https://store.steampowered.com/app/1...ko_Ghost_Jump/

                Comment


                  #9
                  Originally posted by SWipiS View Post
                  yea.. and maybe can you tell me why there are no ConvertMouseToWorldSpace in my player blueprint? or maybe where to use this in player blueprint or playercontroller bp?
                  Use "GetPlayerController" and from it you can get the Convert node. I think it's a PlayerController function (:
                  You can use that where ever you like.

                  If often decide between PlayerPawnBlueprint and PlayerControllerBlueprint by answering the following question:

                  Does the Player need to use this Input even if the PlayerPawn is destroyed or just not available/changed?

                  If not, then you can place it in the PlayerPawn. But if you need it to be working even if the PlayerPawn is destroyed or not the
                  same (for example switching from Human to Car Pawn), then you place it into the PlayerController.
                  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
                    ok all of this looks pretty hard , so for now I watching some documentation about raycasting
                    And yes I agree with you VictorBurgos - eXi is awesome.

                    Comment


                      #11
                      Here it is I found some examples here is the BP:
                      Click image for larger version

Name:	test1.jpg
Views:	1
Size:	248.1 KB
ID:	1101344
                      Click image for larger version

Name:	test2.jpg
Views:	1
Size:	66.9 KB
ID:	1101345
                      so now (I think) my player should rotate to the point where I clicked with mouse button, PlayerController rotating but player it self not any ideas whats wrong?
                      Thank you.

                      Comment


                        #12
                        First thing i see is, that you use "Pitch". The UP-Axis in UE4 is Z (Yaw). So you need to use that.

                        And you don't need the "Make Array" for "Actors to Ignore". I mean, you left them null anyway.

                        Then i would move the "Branch" and the Boolean INFRONT of the LineTrace.

                        Why Tracing if you don't want to rotate? Saves a bit of performance in the long run if you always make
                        sure stuff is not called if you don't need it.

                        (Side Node: Maybe put all the "EventTick" stuff into a function to clean up the Event Graph)

                        Then you need to check if your Character is using the "ControlRotation" to be rotated. Because then
                        "SetActorRotation" won't do stuff. Then you need to get the PlayerController again and call "SetControlRotation"
                        and plug the "MakeRotator" ReturnValue into that instead.

                        (Another Side Node: Make sure to use the "ReturnValue"(Boolean) of the LineTrace so you know if you hit something at all.
                        You are getting the DisplayName of the HitActor without even checking if that thing is valid. Making sure (with the Boolean)
                        that you actually hit something is important to avoid "Accessed None" Errors. A simple "IsValid" check on the HitActor would
                        also work.)
                        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


                          #13
                          hey. Ok about I hit something or not, I dont know I did good or bad but I put sphere inside player BP (scale=100) so every time I hit mouse button I getting on screen player_number(I guess it is hitting sphere). i think this is good because I have point where to rotate and go (the same principle I used in unity)
                          Now I will look into how to check my character is using Controller rotation or not.

                          And what do you mean "put all the "EventTick" stuff into a function"?

                          Thank you

                          Comment


                            #14
                            Originally posted by SWipiS View Post
                            hey. Ok about I hit something or not, I dont know I did good or bad but I put sphere inside player BP (scale=100) so every time I hit mouse button I getting on screen player_number(I guess it is hitting sphere). i think this is good because I have point where to rotate and go (the same principle I used in unity)
                            Now I will look into how to check my character is using Controller rotation or not.
                            Ah, so you trace the sphere? Yeah ok, i thought you trace your surroundings.

                            Originally posted by SWipiS View Post
                            And what do you mean "put all the "EventTick" stuff into a function"?

                            Thank you
                            Yeah well, the line trace stuff. Make it a function. You are currently working in the EventGraph directly. Making stuff into functions should always be the first thing
                            to do when creating new logic. I don't think you put every code you had directly into the Update functions of Unity, but created functions that were called.
                            Last edited by eXi; 02-27-2016, 02:11 PM.
                            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


                              #15
                              good to know that Event Graph same as Update in unity I fixed that. now trying to find way how to check character is using controller rot. Thanks!

                              Comment

                              Working...
                              X