How to set First Person actor (First person Camera)Location to a specified Target Point in a Actor blueprint?
Hello guys,I'm new to UE4 and Blueprint. Now, I have a problem. I want to set my actor location to a target point in a actor blueprint,not in a level blueprint. I use a button on a widget to execute custom event to make the above progress come true. Now, my widget works fine, but I can't teleport my first person actor to the a specified target point. How should I do? Thank you. PS:I'm sorry for my poor English.Wish you could understand my meaning.
asked Jul 13 '16 at 07:10 AM in Blueprint Scripting
This looks correct, so i assume the question lies more in how to get the location. Depending on your game there is multiple ways to implement this. One might be better than the other in this case.
However with not knowing much else what i would do is:
In your playercontroller create a new custom event and name it. Call this in your widget, when the button is clicked. You can do that with a ‘get owning player‘ which you then cast to your custom playerController. On cast, you can now call your custom event.
In your custom event put all the logic you want to have (setactorlocatopn). To get a variable location create a new varr of vector3 in your player controller and get its value into the setactorlocation. When you want to change your location (maybe in levelblueprint?) You do a cast again similar to your widget. GetPlayerController, castToMyPlayerController, set vector3 variable.
Please note, that depending on your game, there is other ways to implement this.
Mostly talkin about multiplayer games right now.
answered Jul 13 '16 at 08:00 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here