Click on object to teleport or move there.

Hi All,

I’m building an art gallery. I want people to be able to click on a piece of art and then zoom or teleport there. Ideally it just plops you there. I’ve seen lots of tutorials that explain just about every mode of teleportation and moving characters but not this movement for some reason. Perhaps I don’t know what I’m looking for. Anybody know of a resource which could lead me the way?

Kind of a noob at unreal. Mostly a VFX and Motion graphics artist.

Thanks all.

1 Like

Here’s one approach.

  • in the Project Settings create a New Object Channel for art pieces only:

  • ensure that your art pieces (meshes) are of that type - Object Type: Art:

And you can then teleport with right click like so:

This will place the player 300uus in front of the clicked Art piece, facing it.

Image from Gyazo

Movement Interpolation can be easily worked in from here on. You will need to adjust the camera and so on, of course. This is just a stub example.

Do you mean in first or third person?

First Person

Oh wow, Thank you for the time you took to share this. I am going to give it a shot. Awesome!

Alright. Produced your rig. It works except that I am placed to the right of my artwork, facing it (as on edge) in the x axis of the art. I was thinking that I simply add a 90 degree rotation to the facing vector but that doesn’t work. I guess I could change and rotate my static mesh’s axis but I won’t always have control of what assets I get. Thoughts?

To demo it I added an arrow component one can move and rotate freely in the scene:

And the user can take advantage of that:

I guess I could change and rotate my
static mesh’s axis but I won’t always
have control of what assets I get.

It would be much easier and consistent to rotate the art mesh inside the actor to always face actor’s forward / desired direction (or better do it the 3d suite if you can). This has to be done manually if you cannot rely on the asset to always face the same correct direction (forward X). It takes a human to tell that; if I model a dog and flip it upside down in the 3d app and export it like that, the engine can’t tell.

I would only apply the additional rotation if I was 100% certain that absolutely all models are borked in the same fashion and there were hundreds of them - too many to fix manually.


One note, if you do not wish to fiddle with vectors and rotations, you can add a Scene Component to the root of the actor that has the mesh - a dummy. You can then move and rotate that Dummy inside the actor and have the player teleport to that component instead.

You can even make a feature out of it. The dummy can be a visible static mesh platform on which the user is placed after clicking on the asset. So you end up with:

  • the user clicks on the actor with the asset
  • get that actor’s dummy’s location and rotation
  • position and rotate the player accordingly, using the above values

This way each actor can have its own dummy platform in a different location and with unique rotation. Depending on how the end product is supposed to work, it might be a preferable workflow that allows you to adjust everything visually in the scene, and on the fly to boot.

You will need to cast the Hit Actor first to get access to the component’s values.

Do tell once you get it to behave the way you imagined.

To make the above method work better, I’d probably add an editor callable event that automates the rotation, pointing the dummy at the asset automatically. Manipulating the 3d rotation gizmo can be a tad awkward at times.

And good luck with the rest!

Thank you,

I believe I have learned more from you than in 2 weeks of tutorials. Thank you. You are doing the work of the lord. Which lord? Can’t say. you take your pick.

Okay, I tried VLerp, ease, and VInterp to no avail. Made a variable for destination, got controller location for beginning.
What should I do to interpolate?

And I should add that for some reason the trace only works for “trace complex” which unfortunately lets me click artwork in other rooms. I have a feeling that’s to supposed to be how it works. Heh. Not sure what i did but that’s cropped up after it was working for the day.

There are many ways to interpolate and you always need to sample previous results, here’s one:

Image from Gyazo

I do not know what method you’re using for movement. Here I needed to disable movement and account for control rotation. The settings are restored once the target position and rotation are reached.

And I should add that for some reason
the trace only works for “trace
complex” which unfortunately lets me
click artwork in other rooms. I have a
feeling that’s to supposed to be how
it works. Heh. Not sure what i did but
that’s cropped up after it was working
for the day.

Assuming you only want the player to be able to move to the objects in the very room they’re in, you’d need to associate the artpieces with their room.

The easiest method that comes to mind is using the collision volumes and tags:

  • each room has a collision volume with a tag
  • at begin play, each Artpiece checks what volume they’re in and assigns the room’s tag to itself (so you do not need to do it manually for hundreds of objects)
  • when the player clicks an Artpiece, you compare the tag of the room they’re in with the tag of the Artpiece, if the tags match, they can move

I don’t see how I can cast to Art Object Type or even an array. How did you get that node? I don’t search with context on.

It would be the actor that owns the static mesh. You must have created an actor that has the mesh, the arrow (optional, of course) and whatever functionality you want to encapsulate. Placing just static meshes in the level will not get you far.