At every step, I am encountering a stupid bug. I would be glad if you can provide some insight. I hope I am stupid and doing something wrong and this is not a bug.
Here is my setup:
- I have a class AInteractableBase, which has a camera object ACameraActor* TempCameraActor.
- I assign this is marked as EditAnywhere, and I assign a camera object that exist in my level.
- When I interact with the object, I use blend camera, I do a nullptr check before of course.
- I have 2 AInteractableBase objects. One of them is a blueprint based on AInteractableBase, BP_Interactable1. This has some additional meshes and visual stuff. Other one is created directly dragging AInteractableBase from c++ classes folder in context browser. Then I assigned a mesh to this.
- I assign same camera actor to TempCameraActor for both objects.
Here is what happens:
- For raw c++ object, everything works flawlessly.
- For blueprint based one, nullptr check fails. TempCameraActor is detected as nullptr for some reason. So my code doesn’t work for blueprint one only !!
Here is another error I had 10 minutes before this:
- I was creating a camera component UCameraComponent* InteractionCamera.
- Then I do CreateDefaultSubobject and SetupAttachment, usual stuff.
- Suddenly my object has 2 cameras !!
WTF is going on? Why is this engine so buggy, what am I doing wrong, why does my blueprint object fails nullptr check?
Edit: I forgot to mention that for blueprint object, whole thing worked once and never worked again.