Camera stuck inside character after respawning

( When you press O it just spawns a new player )

  1. Delete the BP_actor_follow ( I don’t know what that does )

Uh, that’s the camera blueprint I’m trying to use. I don’t want to use the default camera because it’s terrible for reasons I previously stated:

No, the camera is it own separate blueprint because if the camera was directly attached to the player like with the default player character then the camera would follow all of their movements. I didn’t want to happen because it meant that the camera would be moving when the player jumped making platforming a lot harder, due to screen always moving upward whenever the player jumps which in turn would result in the player being unable to see what they’re trying to jump over.

The blueprint I’m using as shown in the tutorial video I linked above, allows for the creation of a “dead zone” which is a area of the screen that the camera doesn’t move in. way I could setup the camera so that it wouldn’t move on the Z-axis until the player reaches near the very top or the very bottom of the screen.

I want to fix the camera blueprint not throw it out, otherwise I’m stuck with a awful camera that I don’t want to use.

The camera blueprint works for the most part, its just that it doesn’t seem to know what to do when switching actors, and that’s the problem I’m having.

Ok! - I have your error - looking into it…

Ok, so it works. What I did.

  1. Get rid of the camera and swing arm from the player, it’s just asking for trouble.

  2. On player death, you spawn the new character and then posses it ( like I showed above )

  3. In the player BP, I have on begin play:

So, when you have a new player, the player tell the BP_ActorFollow to watch itself.

  1. I also put an extra event in the BP_ActorFollow, just so I could re-trigger the begin play meachanic:

I had the camera in the player scenario until I did 4.

I’m getting a lot of errors now, will come back about that…

Ok, working, no errors, no camera in body, no nothing :slight_smile:

Some slight changes. The player dying and the spawn of the new player, all take place in the player BP. gives you a change to turn off tick ( which was causing all the errors ), before messing around with the controller. Player begin play now looks like :

And the key of death and re-spawn ( my O ):

292734-respawn.jpg

( the reset camera event is just a custom event plugged into the begin play in the BP_ActorFollow )

Thanks, although I do have a couple of questions:

  • So I have to move the death & respawning functions into the player blueprint? I was planning on having multiple different characters to play as, so would mean that any modifications I made to the death & respawn functions would have to be made to each character’s blueprint individually.

  • I need the Actor to Follow variable? I altered my version of the camera blueprint to remove all reference to the Actor to Follow variable, as well removing the everything from the Construction Script as demonstrated below. So in order to make your setup work I would have to revert all the changes I made to the camera blueprint?

Former Construction Script:

New Y Value:

New Z Value:

  • I need a custom event attached to the Set Target View with Blend event connected to the EventBeginPlay node within the camera’s blueprint so that the custom event can be called in the player’s BeginPlay setup?

I guess I should also get rid of the Set Camera custom event that’s connected to the aforementioned moved Construction Script coding, since it looks like I have to revert the coding back to the Construction Script.

To your words:

So I have to move the death &
respawning functions into the player
blueprint? I was planning on having
multiple different characters to play
as, so would mean that any
modifications I made to the death &
respawn functions would have to be
made to each character’s blueprint
individually.

It’s actually the perfect place to have the death. The respawn could be elsewhere.

I need the Actor to Follow variable? I
altered my version of the camera
blueprint to remove all reference to
the Actor to Follow variable, as well
removing the everything from the
Construction Script as demonstrated
below. So in order to make your setup
work I would have to revert all the
changes I made to the camera
blueprint?

I think it uses the variable to know which actor to follow ( right? ). I assume you’ll need it in some form…

I need a custom event attached to the
Set Target View with Blend event
connected to the EventBeginPlay node
within the camera’s blueprint so that
the custom event can be called in the
player’s BeginPlay setup?

Yes, that’s what I said. In fact, that’s the bit the puts the camera in the right place, and it happens when a new guy is ‘born’, so the logical place is in the character.

Okay, so I finally managed get it working, although I had to move the entirety of the damage & respawn systems into the character blueprint to do, which in turn required making changes to other areas as well such as animation & enemy blueprints.

Like I’ve mentioned before, the game I’m making involves multiple different playable characters, so I wanted the damage system to be in the Player Controller blueprint. That way any changes I made to the damage system would be applied to all the characters, as opposed to having to make the same alterations again-and-again to multiple blueprints. The increased complexity of having multiple damage systems across multiple blueprints in-turn also increases the probability of errors occurring & going unnoticed.

But if is the only way to get the camera blueprint working properly then I guess have no choice, do I?

Also I’m still getting these error messages in the Message Log:

As far as I can tell it appears to be the result of the actor being destroyed before the new actor is spawned:

I would try destroying the actor after the new one is spawned, but I don’t know how to destroy a un-possessed actor.

And finally, isn’t going to cause problems when the level is reset is it? Because at some point I’m going to need to implement a way for the level to reset upon the player character’s demise, and I just want to make sure whole system of resetting camera isn’t going to cause issues when the entire level is reset.

Moogle, glad to hear you’re getting closer. On some of your points:

*) It might be good to have the damage system in the player BP because different players can then be damaged in different ways, the whole point of object code

*) After unpossess you still have the actor reference, don’t you? That’s all you need to kill it.

*) I think the errors are still coming because you have Tick on, you have to turn it off before you kill the actor…

Hey! - saw and thought you might be interested :slight_smile: