Doble click to move actor on all axes

Hello

I need to know if is posibile to make an actor to move on all axes, let say im in space and i wana move the actor by double clicking in any direction, i had some tries but none worked, if someone can give a basic example of how can be done so i can start from there.

i wana move the actor by double
clicking in any direction

Your screen is 2d - so you can’t have any direction, and the space is 3d so you need to take that 3rd dimension from somewhere - perhaps you double click and the actor moves in the direction it’s facing?

Could you produce an example or a sketch of how this would work?

Let say that i have sphere wich will be the space, actor will be in center (start point) and to move the actor i wana double click in any direction.

To make it better to understand, there will be no " LandScape". just space and i wana move the actor on all 3 axes Y Z X by double clicking in that direction, like flyng but instead of using keys i wana use double click.

Let say that i have sphere wich will
be the space

Not sure where the sphere you mentioned is coming in here.

  • are we inside of a hollow sphere
  • on the surface of a sphere
  • is the camera inside the sphere with us
  • do we need to interact with it somehow

Regarding movement:

  • are we moving at a constant speed at all times
  • does the click dictate when we move
  • or is the click responsible for direction only

I could go like this all day. It’s pretty much impossible to imagine what you have in mind. Especially the spatial aspect of it.

Do you have an example of the movement you’re talking about? A crude sketch with arrows? A YT vid? Another game that used something similar?


Anyway. you can convert mouse location to world coordinates like so:

Image from Gyazo

Other than that, I have no idea how else it’s supposed work atm.


You can also create virtual planes with line-plane intersection node, that would allow you to move in any direction; you provide the location and a normal and get a 3d world coordinate, and that’s without relying on world geometry.

You could then line-trace from the actor towards a line-plane intersection result of the mouse-to-world conversion. That’d give you freedom of movement based on the actor location, unlike the one I demoed above which is based on camera position.

It is a bit hard to explain every aspect from first time.

  • doubleclick will set the max speed and direction of the actor once it triggered

  • direction is still based on camera but you can rotate camera and double click in diferent direction ( like you show, but you can rotate camera to choose a different direction)

  • sphere is hollow, is just an image with stars, planets etc (like sky_sphere bp where you see clouds)

  • camera is with actor all time

  • the problem i face at the moment, i when i click the actor moves only on axes Y and X it never goes to Z when i click

  • As example if you know game eve online, i try to do that movement with double click.

direction is still based on camera but
you can rotate camera and double click
in diferent direction ( like you show,
but you can rotate camera to choose a
different direction)

In this case, what I’ve shown above should work OK-ish - at least for now. Imagine you’re shooting a 5000 uu long ray from the centre of the screen (camera) using mouse cursor as the target. The red arrow is pointing at where that point would be in 3d space - here demonstrated by the orange sphere:

Image from Gyazo

It’s camera based already - the example above actually has a standard springarm camera setup. Rotating the camera should work fine (untested, though),

doubleclick will set the max speed and
direction of the actor once it
triggered

The velocity is whatever you put into the scale value - it scales and accumulats vectors over the duration of a frame and then applies it to a Floating Pawn Movement component of that Pawn:

The component has some basic variables already but you will, most likely, want to add your own movement methods.

sphere is hollow, is just an image
with stars, planets etc (like
sky_sphere bp where you see clouds)

You can use the existing sky_sphere, sure, and assign your own material to the mesh, you could get decent enough results with something as basic as:

Image from Gyazo

You will need to have some understanding of how materials & cubemaps work:

the problem i face at the moment, i
when i click the actor moves only on
axes Y and X it never goes to Z when i
click

When using what I suggested or… ? Maybe you’re using a character movement component and forgot to disable gravity?

Problems is now that it moves only in one direction no matter where i click and it wont stop due EventTick, it will keep going

I did as you show me in print. but maybe have something to do blueprint it self, what i use Character not a Pawn

I think we’ve got some things mixed up here.

You’re using an inherited character movement component. Initially you said that you’d be moving an actor, yet here we have a fully fledged character - which is a highly specialised type of actor not really geared towards the kind of movement you’ve described.

Slapping a floating pawn movement on top here does absolutely nothing.


For a Character, ensure the gravity scale is set to 0 and experiment with this:

318934-screenshot-2020-10-16-164400.jpg

Untested but should allow you to move in Z freely. Not sure how well this will work. Might be great, might be terrible.