Set View Target With Blend doesn't work with player vehicle?

I have a player-controlled vehicle and i want to possess another camera in the level but the Set View Target node requires a “player controller” input which doesn’t work with the controller i get from the vehicle. What am i supposed to do?

As the node states, Target is Player Controller. It can’t just be any ol’ controller. It’s gotta come from the Player Controller Class. Does your BP_PlayerVehicle derive from PlayerController Class?

The Controller is typically for inputs. I’m not sure what the rest you got going on, by if you are swapping the player between a pawn and a vehicle, maintaining the same controller, then referencing the same controller should work fine.

How do I check what controller I’m using? The vehicle blueprint is just the one that comes with the vehicle template, so it should just be the default.

You can hover over the asset in your content browser and it should say the parent class. You can also double click the asset to open the blueprint editor, and it will be in the very top right. It’s probably from a vehicle class that is not related to the character, since it’s from a template.

The parent class is “Wheeled Vehicle”, so what should i do to possess a separate Camera actor?

Well, I’m not sure of your entire setup, I’ve not worked with the vehicle template for a long time and I probably did things different based on my goals - have you tried plugging in “get player controller” into the view blend?

Yes, it worked! I wonder what the difference is though? Since either way I’m getting the controller from my pawn.

If the UnPossess call works, then I guess the Cast node works too. I don’t know if that’s true though. I would imagine it fails because PlayerVehicle would not be a Pawn class (unless Wheeled Vehicle derives from Pawn). The controller class is the parent to player controller iirc, whereas the View Blend node requires player controller. Moreso, it means an AI controller couldn’t use this node.

For player references, using the “get player X” nodes are more reliable and don’t require additional casting. To learn more about the hierarchy of classes, you can find it all when you make a new blueprint - there are the 7 common buttons, but at the bottom of this creation window has access to all classes and if you open the items up, you can see the hierarchal inheritance of classes.

For example, Object, as you see is at the top, all things are Objects, Actor is a child of Object, and if you open this up you’ll find Controller, and in that, Player Controller and AI Controller at the same level. This means there is code in Controller that PC and AIC get, but then PC and AIC have their own unique code at their level. Deriving from that class gives you all the logic down to that class, so calling functions native to a class will work. For example View Blend being specific to Player Controller and not Controller. View Blend function exists at the Player Controller level.

This helps a lot, thank you for the detailed explanation!