Download

PlayerStarts

Hi folks,

Is it possible to do some form of enable / toggle system for player starts like in UDK?

At the moment I’ve resorted to storing a spawn points location in the game class and moving the pawn to the one I want when one is destroyed / created which seems a bit over the top?

Cheers for any ideas

Greg

What about tags? It’s a work around, but it’s less of a work around if you get what I mean.

Yer I’m working with tags on the initial spawn, I tried doing a checkpoint system with them but for whatever reason on respawn it defaulted to the 1st checkpoint.

I’ve added a pic for now, I’m just updating one checkpoint actor for respawns which appears to work OK but it just seems hacky haha

Cheers

Greg

I might do a tutorial on checkpoints. Here’s how I do it in a nutshell:

*NOTE: I don’t like Unreal’s “respawn” system. I prefer to have my own death control, where I don’t actually destroy the player actor, but rather “jails” it using bools like “CanMove”, “CanAttack”, “CanJump”, ect. I then control its visibility, and create a function for resetting everything when I move the player back into the “respawn” location.

I am going to use the default respawn method here, and assume you are not restarting the level. This isn’t perfect, and I don’t do level streaming, so I don’t know what the results will be with level streaming. I am primarily a 2D game developer.*

  • Make a blueprint actor called CheckPointObject, give it a box collision component.
  • Make a variable on your CheckPointObject called CheckPointOrder, it should be an INT, and public.
  • Make a variable on your CheckPointObject called CheckPointFacing, it should be a rotator and public.
  • On the begin overlap, first loop for all CheckPointObject(s), then get their variable CheckPointOrder.
  • If CheckPointOrder is < the current CheckPointObject(s) (the overlapping one) CheckPointOrder, then delete that CheckPointObject.
  • Now loop for (or have it set in your GameInstance/GameMode variable) your PlayerStart object, and move it to the CheckPointObject location.
  • Set the PlayerStart rotation to the CheckPointFacing variable.

In this way, you will get a linear checkpoint system, without much of the hassle. This is one of many ways to do it, and it saves allot of headache.

Again, this assumes the level doesn’t restart, and if you are using streaming maps, make sure you checkpoint immediately before anything else happens after the new level streams in.

That’s pretty cool nice one, thanks for sharing! I am doing the same but with a much less modular approach, I’ve got a bunch of trigger volumes spread through the level that are then updating the player start actor in the game class. I like the idea of making it a drop and place checkpoint blueprint that does most of that automatically.

Cheers

Greg

Yeah, basically it can be used anywhere, anytime, without worrying about the other checkpoints.