@@ -624,6 +624,12 @@ uobject.simple_move_to_location(x, y, z)
624624
625625move to a location using navmesh (see Navigation below)
626626
627+ ---
628+ ``` py
629+ clicked_actor, x, y, z, nx, ny, nz = self .uobject.get_hit_result_under_cursor(channel)
630+ ```
631+
632+ get the world point under the mouse cursor (see Navigation below, for an example usage)
627633
628634Automatic module reloading (Editor only)
629635----------------------------------------
@@ -660,7 +666,7 @@ class ActorGoingUp:
660666Navigation
661667---------
662668
663- The only exposed navigation-related method is 'simple_move_to_location'. It expects a Pawn with a movement component (like a character )
669+ The only exposed navigation-related method is 'simple_move_to_location'. It expects a Pawn with a movement component (like a Character )
664670
665671``` py
666672class MoveToTargetComponent :
@@ -674,6 +680,21 @@ class MoveToTargetComponent:
674680 pass
675681```
676682
683+ Another example for diablo-like movements (click to move, add this component to a character)
684+
685+ ``` py
686+ class Walker :
687+ def begin_play (self ):
688+ self .uobject.show_mouse_cursor()
689+ def tick (self , delta_time ):
690+ if not self .uobject.is_input_key_down(' LeftMouseButton' ):
691+ return
692+ clicked_actor, x, y, z, nx, ny, nz = self .uobject.get_hit_result_under_cursor(ue.COLLISION_CHANNEL_VISIBILITY )
693+ if not clicked_actor:
694+ return
695+ self .uobject.simple_move_to_location(x, y, z)
696+ ```
697+
677698Physics
678699-------
679700
0 commit comments