When trying to make an interact component in c++ I was running into difficulties. The goal was to create a component that spawns a sphere that can be placed on any object in blueprint or c++. That sphere would let the component know if something interacted with it. Then the component would let player know that it was touching a component that it has the ability to interact with, at which point the player could press a button to interact, whatever that means for this object. It all worked great without any issues... As long as the root component was the sphere collider. Obviously this would cause many issues as having a mandatory root can cause issues.
Eventually after two full wasted days trying various fixes I came to the realization that it wasn't that the sphere component got disabled. It was simply spawned at 0,0,0. Due to our map not crossing 0,0,0 (so I never walked onto it and got my debug message) and the fact that the component was invisible I had assumed that it failed to spawn. After parenting it to the root (or setting it to the root if one doesn't exist) and setting its location properly my issues disappeared. Unfortunately so did two full days of my life.
By Kenny Phebus
Posted on 4/22/23
Did you like this post? Tell us
Leave a comment
Log in with your itch.io account to leave a comment.