Then I created a BP inherited from this class, and found no location and rotation options in the details of the sphere component.
When I start the game and move the character, the sphere component attached to the character didn’t move, stayed at the orignal place.
I tried to set relative location of the sphere component in the cpp, but it didn’t work.
Here is the Screenshot of blueprint.
I reboot the UE5 engine and everything works.
Problem is solved, but I still don’t know why.
When should I reboot the UE5 engine to compile the code?
If I reboot every time after modifying the code, it may consume lots of time.
Thanks for your reply.
The component created in cpp is attached to root component by default, as shown in the blueprint screenshot.
I initially attempted to manually attach the component to the root component in C++, but it didn’t work until I restarted the engine. . After rebooting, the component functions correctly even without manual attachment.
Unfortunately, I’m now unable to reproduce the issue now. While rebooting seems to resolve many problems, the underlying cause remains unclear.