How do I get the current camera location (including when in the Editor)?

I’m trying to update the visibility of an actor based on a trace between the current camera and the object. I need it to work in the editor too (the objects have depth testing turned on so they always render on top of everything and there could be a lot of them).

I think I’ve gotten most of the way there but I always come back to the provlem of not being able to get a reference to whatever the current camera is. I’ve tried using a Get Camera View but it doesn’t seem to want to refer to “self” for a target and I don’t know what I should be putting in target.

Oh, I’m trying to stick to blueprints for this one.

[Click for bigger version][1]

What blueprint do you have your camera on? You can use GetWorldLocation and use the camera component on the input pin

This will get the currently active camera location in play mode. Don’t know if that helps atall

227408-2018-01-17-17-10-42.png

1 Like