I was making a program where you could change from the third person character default HUD and pawn class to the advanced vehicle HUD and pawn class when you press ‘v’. I used the code below (the event is called when ‘v’ is pressed):
When I press ‘v’ nothing changes, I expect that this is because I am setting the defaults and not the current ones. Is there any way to set the current ones or reload the gamemode so it uses the new defaults?
for the pawn part you should be able to just use the posses node to take control of your vehicle. basically have a reference to the vehicle and then use get player controller → posses and plug in the reference to the vehicle. in theory it should work but i havent worked much with the vehicle template so dont know for sure.
Classes are something you need to spawn and then register it to be used, if there no function that will do that for you.
In case of HUD there, there a function which will spawn and set the HUD:
But in case of pawns you need to do things manually, you need to spawn new pawn, optionally destroy old one and then make PlayerController posses new pawn with Possess node. Default pawn varable will only effect pawn that be spawn by build in re spawn system where for example you will restart the player