Make camera follow more than one actor?

dreph

  • Posts: 142
Is it possible to have the camera follow two actors? I have two actors on screen that have the camera set to follow, but only the second actor is followed by the camera.  Is it possible to have it follow both?

JeffreyDriver

  • Posts: 2262
Do you mean split screen, or tracking midway between them?

dreph

  • Posts: 142
 tracking midway between them specifically. They’re both going to be on the same screen.

 if that’s possible, do I need to check the location of both of these actors and set camera to center of that?   theoretically it would probably be smarter to create a scene behavior instead of an actor behavior?

JeffreyDriver

  • Posts: 2262
That's exactly it. Get the position of the two and work out the centre. A scene behaviour would make more sense to me, but it's about how you like to work.

There's an extension called 'Easy Math' search the forums for that. There's some blocks that you may find useful.

dreph

  • Posts: 142
 thanks, I’m going to give that a shot real quick.

dreph

  • Posts: 142
OK, so I wanted to use a player tracking behavior that I setup for an enemy actor and repurpose it for the camera.  I figured that and the end of it all, it would be more efficient to have the scene track the player and pull that information from the scene for each enemy to track the player, as well as controlling the camera behavior. 

My problem is that it works perfectly for the enemy behavior, but it seems to not pull the information from the Players group actors when attached to a scene.  X and Y show up as 0, even though player count is showing up as 1 or 2 appropriately.  As I said, essentially the exact same behavior was used on an enemy with no issues.  If anyone has some insight that would be stupendous.



« Last Edit: October 30, 2018, 12:09:25 pm by dreph »

dreph

  • Posts: 142
LOL I don't even know what happened, but I closed out the game for a while, came back because I thought I had an idea, then when I tested it, it worked... silly little bug, is all.

dreph

  • Posts: 142
Alrighty, so I did what was mentioned and set the camera center to the average between the two players and it is working flawlessly. Thanks for sparking an idea!