You need to be more explicit with you problem.
Yes, you’re right. Where was I thinking? To be honest, I have this project in my head, I didn’t realize that I didn’t give enough information.
It turns out that I run a code for the second time being the 5th step that checks the option “Is it valid?” if the generated object that would be the variable “New Var 0” is valid, the code will run normally. When I run it again and get “Is it valid?” a second time, the object that is already valid “New var 0” because it already exists never falls on “IsValid” to then execute the 6th which would be to destroy the object> 7th execute a custom event and repeat the process for me to check again and again .
Was it so clear? I may have made everything more confusing… XD
Validate your item on spawn, before any other action. Then Set the variable.
Spawning Actor from Class can fail do to collisions. Set it to ALWAYS SPAWN, IGNORE COLLISIONS, then test.
How could I validate when it spawns before any other action?
How could I validate when it spawns before any other action?
Spawn actor from class → IS VALID
- [TRUE] → Set New Var → Print string
- [FALSE] → Print String
Unsuccessfully. This is what I tried in the images. Does not work. Thank you very much anyway. You have given me a light in the right direction.
If this is printing Not Valid, your actor isn’t being spawned.
You can further debug by adding a print string to the actors Begin Play event.
Yes, you’re right. I reviewed my project and remembered that I use a system where I always invalidate any previously valid items because it reloads everything. I’ll dig deeper to come to a more succinct conclusion and come back with answers. Most thanks for the help.
I created exactly the same function inside my BP player and stored the variable that was being deleted before and not being saved to be used later.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.