I’m trying to make a level where there is a moving platform (circled in blue) that can be respawned using the box trigger (circled in red), but I don’t want it to be spammed so that the player can make infinite platforms. I want to that whenever you press the button, you need to wait at least 20 seconds before pressing it again. How would I do that?
In a blueprint with a static mesh component, create a custom event, I called my one SpawnFloor.
In the blueprint, you need a FloorMesh variable with the mesh of the floor you want to use, and a CanSpawn? boolean variable.
In your level blueprint, you want a reference to the floor blueprint that is placed in your level and call the custom SpawnFloor function.
Remember you need to have a floor referenced inside of your level blueprint floor variable, you can do that by clicking on the eyedropper icon beside the variable’s value on the right.
If you need me to explain anything else just say, and if my answer was what you were looking for I would appreciate it if you marked my answer as correct by clicking the small tick symbol to the left of the answer beside the arrows. Thanks a lot!
I am unsure of why you are getting this error. The floor mesh is the actual mesh you want to use for the floor, it is a static mesh variable that you set inside your blueprint.
If this is in the level blueprint then you need to make sure you have a reference inside of your level blueprints FloorBP value. Click on the variable and beside the value it has, there should be an eyedropper icon, click it and click on the floor blueprint inside of your level.
I did do that, except whenever I walk over the box trigger, nothing spawns
Ok if you have done that then go into your Floor blueprint and make sure it has a static mesh set as a value inside of the FloorMesh variable.
Alright I put a cube as a static mesh in the Default value
You could also check the collision of the object you are using to trigger the trigger box. Make sure that it has generate overlap events set to true.

Is it giving you errors or is it still not appearing? Remember you can always check if code is firing by using the print string function, just connect it to wherever you want to debug and it will print a string to the screen if a signal has gone through it.
It is not giving me any errors but nothing spawns
Alright use the Print String function in your level blueprint and print Level with it and use it in the floor blueprint to see if the events are firing.
I don’t know how to use the Print String function
Connect it to the trigger event in your level and play the game, if nothing happens then send me a picture of your level blueprint, but if a “Hello” message comes up on your screen then it’s working, in which case you need to double-check everything in your floor BP.
Oh, make sure the CanSpawn? boolean is set to true.
Ah good finally something spawns, but now I need it to be the moving platform
Ok you should follow along with some tutorials from here: How To Make A Moving Platform (The Basics) | UE4 Tutorial - YouTube





