I'm currently trying to cast to the player blueprint via the game mode blueprint, whilst using the 'Get Player Pawn' node as the wildcard object and using a function from the player blueprint as the target. However, this doesn't seem to work as it just results in a cast fail. I've included images below showing the code for the casting operation, as well as the function itself that I'm casting from the player blueprint. If anyone has any advice it would be greatly appreciated.
Announcement
Collapse
No announcement yet.
Failing to cast to Player Blueprint
Collapse
X
-
-
Is there a player pawn? Are you calling this after some sort of player death logic where the pawn is destroyed?"I have harnessed the shadows that stride from world to world to sow death and madness."
-
Originally posted by EvilCleric View PostIs there a player pawn? Are you calling this after some sort of player death logic where the pawn is destroyed?
But perhaps this currently isn't working because there is no pawn or player even spawned at that current time, and this whole procedure IS to get a player to spawn.
Comment
-
After all you are spawning a "PhysicsBallBP" in the "SpawnPlayer" event, which is called after the cast.
And what's the purpose of the cast and the get player pawn there?Last edited by EvilCleric; 04-20-2018, 03:13 AM."I have harnessed the shadows that stride from world to world to sow death and madness."
Comment
-
Originally posted by EvilCleric View PostAfter all you are spawning a "PhysicsBallBP" in the "SpawnPlayer" event, which is called after the cast.
And what's the purpose of the cast and the get player pawn there?
Comment
-
Originally posted by TannerVEVO View Post
The purpose of the cast is to activate the 'Spawn Player' function which in turn spawns a player into the level.
How about moving the "Spawn Actor" to the gamemode, and then call the "Spawn Player" to do all the rest you have in it?
Or even do all the spawning operations in the gamemode?Last edited by EvilCleric; 04-20-2018, 07:35 AM."I have harnessed the shadows that stride from world to world to sow death and madness."
Comment
-
Originally posted by EvilCleric View Post
I see. So you are spawning a player pawn from the player pawn itself ...
How about moving the "Spawn Actor" to the gamemode, and then call the "Spawn Player" to do all the rest you have in it?
Or even do all the spawning operations in the gamemode?
The node within the blueprint, and the array section within the level can be seen in the images below.
Comment
-
Before anything else, did you check if "Get Player Pawn" is valid? Have you checked if in any moment the instance of the player Pawn gets destroyed or the controller UnPossess it?
Possible solutions:
1 - if order doesn't matter, then for example in gamemode, you could use "get all actors from class" or "get all actors with tag" to automatically fill the array
2 - if order is important, then create a BP, that contains that data
3 - if you are not using the default player controller, then you can manage all the respawn from there
4 - ...
One good tutorial that deals with respawn, player controller, respawn points and all that, is the BP Time Attack Racer ( https://www.youtube.com/watch?v=VJj6...GpCF6LCgBz9XeS ).Last edited by EvilCleric; 04-20-2018, 02:02 PM."I have harnessed the shadows that stride from world to world to sow death and madness."
Comment
Comment