Change player location to hitbox location
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
asked Sep 12 '15 at 12:13 PM in Blueprint Scripting
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.
answered Sep 12 '15 at 03:04 PM
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!
Follow this question
Once you sign in you will be able to subscribe for any updates here