Download

How to use game instances to set a variable?

I’m trying to make a rhythm game prototype, but i’ve never used game instances before.

When the hitbox registers an input it should send a printstring saying ‘lowboxoverlap’. I tried using a variable in a game instance and using it so that when the boxcollision registers an overlap that the value sets to 1. And when the overlap stops the overlap changes back to 0. I’ve put the blueprint seen in the last picture in the game instance blueprint, but it doesn’t work.

How can I make this work? Thanks in advance!

Not quite sure what you’re trying to do. Your game instance code is fine.

What is triggering Custom_event_0?

The main reason for using the game instance are things like:

  1. Passing variables between levels

  2. Passing variables between the level BP and other BPs

  3. Passing variables between widgets and other BPs