# Click on object to teleport or move there.

**URL:** <https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045>\
**Category:** Architectural and Design Visualization\
**Tags:** teleportation, archviz, unreal-engine, question\
**Created:** [May 12, 2020, 5:07am UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045 "2020-05-12T05:07:29Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![pleaseluggage](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pleaseluggage](https://forums.unrealengine.com/u/pleaseluggage)\
**Post date:** [May 12, 2020, 5:07am UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045/1 "2020-05-12T05:07:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 12, 2020, 7:38am UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045/2 "2020-05-12T07:38:13Z")

</div>

Here’s one approach.

- in the _Project Settings_ create a _New Object Channel_ for art pieces only:

 ![301678-channel.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/4/e/64e60ad70e6010f6b84ebed9ebb1f7226a9febaf.jpeg)

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

 ![301679-collision.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/a/9/1a92e89ae6fdb67e82aa689850b8734b6aab64aa.jpeg)

And you can then teleport with right click like so:

 ![301701-script.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/4/0/d404afd036e0fd8eac66b18a10acdb601fab473c.jpeg)

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

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/7/a/27aaa4cf3185ab2c149a996a387f170f64155b8e.gif)](https://gyazo.com/74b6285729eed06603ac6783476d9f45)

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.

---

<div class="post-metadata">

**Author:** ![ClockworkOcean](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/clockworkocean/32/1169999_2.png) [@ClockworkOcean](https://forums.unrealengine.com/u/ClockworkOcean)\
**Post date:** [May 12, 2020, 9:51am UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045/3 "2020-05-12T09:51:57Z")

</div>

Do you mean in first or third person?

---

<div class="post-metadata">

**Author:** ![pleaseluggage](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pleaseluggage](https://forums.unrealengine.com/u/pleaseluggage)\
**Post date:** [May 12, 2020, 7:48pm UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045/4 "2020-05-12T19:48:32Z")

</div>

First Person

---

<div class="post-metadata">

**Author:** ![pleaseluggage](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pleaseluggage](https://forums.unrealengine.com/u/pleaseluggage)\
**Post date:** [May 12, 2020, 7:49pm UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045/5 "2020-05-12T19:49:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pleaseluggage](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pleaseluggage](https://forums.unrealengine.com/u/pleaseluggage)\
**Post date:** [May 13, 2020, 8:22am UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045/6 "2020-05-13T08:22:13Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 13, 2020, 9:10am UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045/7 "2020-05-13T09:10:01Z")

</div>

> 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.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 13, 2020, 9:48am UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045/8 "2020-05-13T09:48:48Z")

</div>

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

 ![301765-arrow.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/5/c/b5c4cbb1dde212433f99f28e8a59aa9525c651f5.jpeg)

And the user can take advantage of that:

 ![301766-comp.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/b/2/db2cf68660a49ceae3d722c81137d227fcc5474e.jpeg)

---

<div class="post-metadata">

**Author:** ![pleaseluggage](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pleaseluggage](https://forums.unrealengine.com/u/pleaseluggage)\
**Post date:** [May 15, 2020, 8:33am UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045/9 "2020-05-15T08:33:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 15, 2020, 8:43am UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045/10 "2020-05-15T08:43:20Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![pleaseluggage](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pleaseluggage](https://forums.unrealengine.com/u/pleaseluggage)\
**Post date:** [May 15, 2020, 9:39am UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045/11 "2020-05-15T09:39:32Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pleaseluggage](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pleaseluggage](https://forums.unrealengine.com/u/pleaseluggage)\
**Post date:** [May 15, 2020, 9:43am UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045/12 "2020-05-15T09:43:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 15, 2020, 11:01am UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045/13 "2020-05-15T11:01:50Z")

</div>

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

 ![301967-graph.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/5/3/853b5ceed77d26e9ae281f0529c67275fc3adc0f.jpeg)

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/f/9/6f974ead0a1f0de1131669c3b7a47ae8b8d48eb0.gif)](https://gyazo.com/16ab50a49b679c4b7a83e77c03a97500)

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.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 15, 2020, 11:07am UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045/14 "2020-05-15T11:07:43Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![pleaseluggage](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@pleaseluggage](https://forums.unrealengine.com/u/pleaseluggage)\
**Post date:** [May 15, 2020, 6:38pm UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045/15 "2020-05-15T18:38:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 15, 2020, 7:10pm UTC](https://forums.unrealengine.com/t/click-on-object-to-teleport-or-move-there/465045/16 "2020-05-15T19:10:01Z")

</div>

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.
