How can I get a 3d object to always face player/camera?

Hi folks, sorry for the rookie question. Whats the simplest blueprint to make a 3d object always face player or camera (2 ways: all axis, and just rotation). Thanks Guys

Check the Math Hall in Content Examples project from Marketplace. It has exactly what you need.

Sorry friend, I am not finding it. Math Hall is a level inside the content exemples?

Yeah. Full name is Math_Hall. If you dont have it you need to download the 4.1 version of the project.

Thanks man! I was using the 4.0.2 version. Now I found it on 4.1.

Use FindLookRotation between both actor locations :slight_smile:

This worked perfectly! Thanks!

This only works on a single object. As soon as you have multiple objects in the scene, they fight over the camera’s location. Also, shouldn’t you be adding a value into the rotate vector’s rotation… they’re all zeros.

This solution was used for a 3rd person character. The function is called on tick. my character is moving (get Not sure how readable the pic is, but the important node in this solution is ‘get unit direction vector’. It takes two objects and finds the direction from one to the other. I used the camera and the flipbook here and only used the Z value when setting the new rotation (the other two make the flipbook spin as I move the camera around).

Easiest solution: Find look at rotation.

Depending on your setup you may need to flip one of the other axes.

While we’re in the giving mood: my 3d solution for a space shooter (same deal with may have to flip something).

###There are two solutions I can think of and which one to use depends on what sort of label you want. I will do the most likely and easiest case first.

Widget 2D image dropped on top of the player’s viewport at the right spot:

###If your goal is to really label something for the player as a part of the user interface this is what you want.

Use the “Project World Location To Screen” function to take a location vector in world space and match it to a location on screen.

308218-first.png

NOTE: Deciding whether to put this in the Event Tick of the UMG widget blueprint or somewhere else would depend on the game. You would have to ask what makes the most elegant solution for your application. Obviously if it was a mechanic that worked for a certain type of pawn or game mode you would not want to put in (for example) the level blueprint.

A floating “billboard” static mesh that will exist in 3D space

If a widget will not get the job done or you want to go for simple weird/fancy (but possibly look pretty cool) you could have something that is a label but also a part of the 3D world. BUT you should keep in mind what this means…

  • Any other object could occlude/block it from view.
  • The detail visible (and readability of any text) would depend on distance.
  • Depending on the game/application it will appear somewhat “unnatural” as it is affected by lighting but looks the same from any angle. Unless someone was looking at it carefully, the extra work you do could ironically make the graphics look less sophisticated. (But if it was a survival horror game there could be good opportunities to create a creepy atmosphere).

As FinalZer0 noted the best way to do this is the Kismet Math function “Find Look At Rotation” which takes two vectors and outputs a rotator that would point an object at the first location towards the second. Just hook it up to the EventTick and update the transform. You could also change the scale of the transform as well on the Event Tick if you really wanted it to appear the same at any distance.

308219-second.png