Possessing a placed pawn
Whitaker Antalek
03/24/23
When it came to setting up players and AI i knew how to accomplish this with single player. Basic AI would be manually set into the world and UE knew to control those with an AI controller over a player controller. Using the Game mode I could easily set up a default pawn to spawn into the world as the main player. This pawn would use a spawn point as its starting point. Easy enough. However, I wanted all the pawns to be placed in the world and i would possess one at the start of the game. This proved to not be as cut and dry as I believed.
The Solution:
Originally, I believed that using the level blueprint was my best option. I would get a reference to the pawn I wanted to possess and setup the possession on it. Turns out I was able to possess the pawn but none of my inputs would work! After some debugging, I figured out that the pawns were spawned in before the level blueprint was called. So, when my pawns begin play tried to set up the enhanced input local player system, it would always fail because it did not have a controller attached to it!
I was able to fix this issue by giving the main pawn two variables. A bool to check if it is AI or not and a integer to check which player it is (one - four). With these two variables I would check within the playerpawns begin play. If the pawn is not AI, possess that pawn with the proper player controller based on that pawns index. Then set up the input system. This allowed me to control whichever pawn I set to not be AI with that bool.
Files
Get Party Panic!
Party Panic!
Race against your friends for the treasure in this 4-player party board game!
Status | Released |
Author | ctrl.alt.defeat.team |
Genre | Adventure |
Tags | Board Game, minigames, Multiplayer, party-game |
Languages | English |
More posts
- Game Over! Continue?Jun 24, 2023
- Reflecting on the Journey: The Finale of Party Panic's Development... or IS it?Jun 22, 2023
- New UI, same old usJun 17, 2023
- Animating A Mesh Without a Skeleton by WhitakerJun 16, 2023
- Animating Text in a Widget By WhitakerJun 16, 2023
- Final Stages and Future Prospects: Party Panic DevlogJun 15, 2023
- The Volcano is active!Jun 10, 2023
- Devlog: Conquering the Challenges in 'Crash'em Karts' - New Kart Racing Mini-gam...Jun 09, 2023
- Camera Angles and using new CamerasJun 08, 2023
- Party Panic! Devlog: Navigating through Challenges and Revving Up for a New Mini...Jun 02, 2023
Leave a comment
Log in with itch.io to leave a comment.