Change player location to hitbox location

Hey guys,

I’m trying to do something quite simple, but I don’t have the knowledge to execute it unfortunately. I’m hope some one more fluent in ue4 can probably help.

I am using the vr game template from the forum made by Mitchell McCaffrey to basically make a simple vr experience. To avoid all the possible sickness caused by locomotion within vr, I am trying to make a simple navigation system using target points and the ray traced hitboxes. Basically the setup I have in mind is thatq when you look at a floating sphere, text pops up saying press a to move here. Hmd/camera fades to black and the player moves to the point if the sphere.

I have created a component with the hitbox, sphere, text and a target point. I have got the text to appear when I look at the sphere/hitbox. My question is How do I make the location of the player character change to this location? I tried to use set actor location within the hitbox/sphere blueprint itself, but it didn’t work. I’m guessing I have to do this in the level blue print. But then how do I reference the target point within the blueprint that is been looked at through the hitbox for the set actor location node?

Any thoughts or help would be much appreciated.
If I am not clear enough, please let me know, I’ll try explaining better.

Thanks in advance

This really depends on the complexity of the movement you want.

Do you just want a simple teleport? Well you take the input of your mouse or whatever you use to activate the movement, saved the location where you want to go (potentially just a variable of the hitbox, the location of the hitbox. Whatever) and just use “Set Actor location” from “Self” within the character (because you want to move the character right?) and it should jump there.

Slow movement can be achieved by interpolating the location. Basically exactly the same. You also use “Set Actor Location” but this time you have the vInterp (a Vector Interpolation) in front of it which will provide you with sub steps making a rather smooth transition.

If you want the character to properly walk considering collision and everything you will need a nav mesh volume and can then use simple movement (unreals integrated path-finding) to move it there.

Or give the player control which you can look up in the third person template how to do. Basically you take the input from your keyboard and apply it as movement input which uses a function in your character movement component and considers all collisions, heights and that stuff.

Cheers

Hey, thanks for your response!
I want the character to simply teleport from a to b and I intend to use a fade to black from matinee between the a and b so that the player doesnt actually see himself moving.
The sequence would go like this:
Look at hitbox —> Press corresponding button (A on gamepad) ----> Fadetoblack and then Fade in again ---->Player is now at hitbox location.
No need for navigation or walking or wahtever. A simple 1-2 second time frame between the teleport where it fades to black is all I want.
My problem is that I have multiple hitboxes around my level and I want the player to telelport to only the hitbox he is looking at (activated through interaction tag).
I hope this clears up what I am trying to do.

I figured it out. I used the linetracebyobject node in my first person character event graph and changed my object type for all my hitboxes to be in a unique definition of object type.
If any one is interest and needs help achieving this, I could post pictures of my setup. Otherwise you can close this question as resolved. Thank you!

It’d be cool if you could post the picture just for completions sake.

If someone has the same issue in a year or such, finds this thread and finds this answer… well it’s kind of a downer ;D

Also you can close the question by yourself if you click on the button right below the answer vote buttons. It will accept your own answer as correct and mark this question as answered.

Glad you solved it :slight_smile: