can't destroy or hide from c++
Hello everyone :)
I'm trying to make my player put an item back in his bag (by destroying or hidding it, it doesn't matter for now). I've tried to call different functions on it : Destroy(), K2_Destroy(), SetActorHiddenInGame(), SetHiddenInGame() on each components or DestroyComponent()
None of this worked. I've checked that my pointer is not null, and that my function is called and it was called in all of my attempts even if I saw no effect.
So I try using a blueprintnativeevent to call hide() or destroy() and put a print after the call to be sure it was called. It was but my actor was still seen by the player. BUT when I changed the blueprintnativeevent from BeginPlay of BP it worked ! So it seems like I use the good function in the good way but as soon as there is c++ involved... it does nothing.
It seems like a weird issue and I have no idea what I could be doing wrong. Does someone have the solution to this ? Or at least encountered the same issue ?
Thanks for your answers :)
asked Dec 13 '14 at 11:59 PM in C++ Programming
I found that it was due to the fact that I was using TSubclassOf to call my function. When using pointers*, it is working properly. I don't totally understand on what the function was called before, but the problem is solved.
Thank you :)
answered Dec 15 '14 at 01:36 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here