Download

Spawning character via blueprint

Hi guys,

Just wondering if anyone can help me sort out a problem when I spawn a new character.

By pressing 2 I have the character change from hands to weapon, however when the weapon character spawns it appears to be in mid air.

Here’s my blueprint and a video of whats happening.

Thanks! :slight_smile:

0af99c95d02b666938add94fc8f8cf1cde74fdfc.jpeg

Maybe cause you spawn your weapon on the camera and not in a socket from your character ?

I tried setting it to the character mesh but that made it spawn facing left and in a slightly different location. :confused:

You have to fix that on your character editor. You can apply a preview with your weapon on the socket you want. Then you can put the good location for your gun.

Here a tutorial for that :

https://www.youtube.com/watch?v=DyPq1-JGMKY

The gun is already attached to the socket. I’m not spawning just the gun its a full character blueprint, so different arm mesh, animations, blueprints, camera etc.

Ideally it would be great if I could switch between default pawn classes in the game modes via blueprint. So pressing a key in gameplay would completely swap the default character BP. Would love to see if that could be done as I can’t find anything onine!

Thanks for continuing to help BTW :slight_smile:

Interesting method. Right now even if the was working your not destroying the previous blue print. So when you press the button multiple times you’d end up with a bunch of the blueprints spawned but sitting idle.

Just theory here but if you did this you’d need to set life for current blueprint on key press to like .2 and the spawn and possess the actor

not sure this is the way to go about this

Very strange that theres no information regarding switching default pawn classes in the game mode via blueprint. People have asked similar questions on here and it’s never really been solved.

You can override default pawnclass but you then need to essentially respawn.

I’m doing that in my came to do teams.

It’s located in game mode.

I use an enum which I set in my playerstate then respawn character and have the override choose defaultplayerpawn based on that enum.

I don’t quite follow, sorry. Would you be able to post a screen shot?

Thanks for your help!