Camera bug on AI

My AI characters extend from my player characters because I wish to be able to take control of them and return them to ai controller at will. Since they’re children of player character, they contain camera and spring arm components. I assumed this wasn’t an issue.

However, if I pass my character between their camera and world location (basically block view of their own camera to themselves)…they disappear. They reappear when I’m no longer directly behind them.

I think this is a bug.

To test if it truly is camera blocking that’s causing this (I’m 51% certain it is), I tried to delete their camera and spring arm components on begin play, but problem still persists. However, I can still reference those components after I have ran the “destroy component” on them so it appears that they cannot be removed at all, effectively rendering that test pointless.

I don’t feel it’s a viable solution to have to create separate classes for AI and player controlled characters because half point of Character class and associating controllers is that anything can control them. Plus I’m lazy and don’t want to.

Hi Hitpawz,

I wasn’t able to reproduce this in 4.6.1. Which version of engine are you using? What type of project is this (third person, 2d side scroller, etc)?

You wouldn’t be able to delete components on a child that belong to parent, so not being able to delete them makes sense. I’m not sure if there’s a problem with inherited spring arms, however, without more details. If you would like to create a sample project in which this occurs and upload it somewhere, I can take a look and see where problem is. Thanks!

Hi ,

Thanks for helping.

project is in 4.6.1 and it’s based off third person template.

I too cannot reproduce this in a brand new project. Give me a day or so to try and strip out just necessary parts to reproduce it. It’ll take me a bit to do that or I’d have to transfer over a gig in unrelated elements.

I’ll message you a link when it’s ready.

I’m starting to feel like this answer hub is like your local car garage. car always seems to fix itself just from sole act of driving onto premises so you can look stupid.

issue is caused by a feature that we added a while back where if spring arm is less than a certain distance, it hides mesh. We’re doing this so that you can zoom camera into first person and also to avoid crazy camera movement when you back up against a wall. So basically I should be able to remove collision on camera or stop that bit of code when controller is AI and it will be fixed.

Sorry guys, I keep doing this…posting and then solving it like 2 seconds after. I swear I actually DO spend a ton of time trying all I can to figure out these issues before I bother anybody with them. Here let me try one thing really quick…Hey guys I have a problem, my game won’t build itself magically…wait for it…darn.

Hah, I know feeling. No worries, glad you got it figured out!