How to drag TargetPoint to the panel？
I don't understand why does the complier not allow me to put object of TargetPoint in a TArray.
This is my code:
In general, I just want to make my character walk through each targetPoint. Now I face a problem. I don't know how can I drag on target points into the slot of the editor. At the beginning, I use type "ATargetPoint*" instead of "ATargetPoint" for my TArray. I can complie it successfully and the slots shown on the pannel, However, After putting the target points into the slots, they are still showing "None". I think may the slot is for type TargetPoint* but not TargetPoint? So I change the TArray to TArray. However, This time I just can't complie the program.
I am new to C++ and Unreal. I really appreciate any help.
asked May 21 '19 at 12:36 AM in Using UE4
Using a pointer is the right way to do it, you should however close the editor and rebuild the solution from Visual Studio (or whichever IDE/Compiler you use)
Changing UProperties is extremely buggy with hot reload and I've had many issues running into null pointers (None) while using hot reload, which I eventually stopped using completely because it simply sucks too much.
You also seem to have a syntax error in line 21 of the cpp (
And also just as a sidenote the upcasting you're doing on line 34 of the cpp isn't necessary (`MoveToActor(Cast(GetNextPoint()));`), if your ATargetPoint is an actor (which it probably is since it starts with A) then the cast will always succeed and isn't necessary since ATargetPoint already is an Actor, and if it isn't an actor then the cast is going to return a nullptr and not warn you or anything.
Edit: I just talked that at some point no matter what I tried to do it was still not working and the "None"s persisted, what I suggest at this point if this happens to you is to make a new blueprint completely and derivate it from the same base cpp class, copy everything you had changed on it and then remove the old one completely, it was the only way I found after the blueprint was already corrupted sadly, if you know if any other way please do share it!
I really hope all of these blueprint corruption issues get fixed soon...
Follow this question
Once you sign in you will be able to subscribe for any updates here