I have my default ThirdPersonCharacter with default movement logic that works fine, and I also have a character pawn that I want to control using different Input mappings with different logic when this character is possessed. I can’t seem to get this working, can someone help please, I lost days trying to figure it out myself and tryed every tutorial and forum answers I can and nothing works. Here are the blueprints for my default character (BP_TDRPG_Character), my companion character that I want to possess and use different input and logic for movement (BP_Companion) and my player controller (BP_TDRPG_PlayerController). Also I have set the references and key functionality to possess between the default pawn and BP_Companion pawn inside level blueprint with 1 and 2 keyboard keys as seen on the screenshot Level BLueprint
Instead of Begin Play, you can assign the input mapping context after Event Possessed
OK I solved it, Thank you for clearing that for me, I am such a noob . Now I have a problem that I have AI controller assigned on BP_Companion that works fine on beginning of play, but when I posses my default player pawn again by pressing 1 on keyboard, the possession works , but my BP_Companion never goes back to his AI Behaviour like on begining of play and follows the player around and so on. How can I make it so that When BP_Companion is not Possessed by player, a specific AI_Controller that I have set up takes over the control of the companion ?
You can make the AI controller possess the companion back after you trigger the character switch (wherever you handle it), or after Event Unpossessed inside the companion’s character blueprint
non of those work if I understood you correctly , I handle the swithing between pawns inside the Level Blueprint as you can se on the ‘‘Level_BP Screenshot’’ attached, If I put the ai controller to possess the companion after I switch back to default player pawn by pressing 1 keyboard event it doesnt work, and also as you can see on the ‘‘Companion_BP Screenshot’’ if I put the AIController to possess Companion after ‘‘Event Unpossessed’’ inside BP_Companion like you sugested it also doesn’t work. Companion stays still after switching back to default player
How did you come to the conclusion that AI controller doesn’t possess it?
Make sure to also run the behavior tree aside from having the AI controller possess the companion, if you handle it’s movement in the behavior tree.
If that doesn’t work out as well, perform some additional debugging by using breakpoints to check if the nodes actually do get triggered as expected and also using the AI debugger in runtime to have a better understanding of what’s going on.
You can toggle breakpoints by hitting F9 while a node is selected, and with that being done, the simulation will stop when the execution flow reaches that node.
By default, you should be able to toggle the AI debugger by pressing the apostrophe (') key in runtime but it depends on your keyboard layout so you might wanna check the editor preferences and assign your desired key manually
Hope this helps!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.