Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

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

Product Version: UE 4.9
more ▼

asked Sep 12 '15 at 12:13 PM in Blueprint Scripting

avatar image

31 3 4 11

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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 **V**ector 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.


more ▼

answered Sep 12 '15 at 03:04 PM

avatar image

5.9k 291 86 293

avatar image kabirpunde Sep 12 '15 at 10:18 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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!

more ▼

answered Sep 13 '15 at 12:29 AM

avatar image

31 3 4 11

avatar image Erasio Sep 13 '15 at 01:31 PM

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 :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question