Hey everyone,
Got tired of the camera snapping and messy AI handoffs every time I tried to possess a pawn, so I built a completely modular framework to end the spaghetti code. I moved the targeting logic to the Player Controller and the actual possession memory to an Actor Component. They only communicate through Blueprint Interfaces.
I didn’t actually plan to make it this clean from the start, but I’m coding on an ancient MX130 laptop lol. If I put heavy logic or casting in the character’s Tick, my PC literally sounds like a jet engine. So I was forced to make it 100% event-driven (using a 0.1s timer for the soft-aim radar instead of Tick) just so I could test it without my laptop melting.
Also, it’s completely AI-agnostic. When you leave a body, it doesn’t force any specific Behavior Tree logic on them. They just idle until your own custom AI takes back over.
Honestly, building this on a toaster was pure suffering, but it forced me to optimize the hell out of it.
I packaged the whole framework and put it up on Fab. If anyone wants to drop it into their project and save themselves the headache, you can grab it here:
Let me know what you guys think of the architecture!