C++ class does not work even though i compiled it

hitting ‘live coding’ button works with no error.
but whenever i see the viewport, what i added does not come to view.
i have no idea how to approach this problem.
the problem arose when i created ‘Grabber’ class.(Was fine since i handled ‘Mover’ class)
one thing i did in different way is that i created ‘Grabber’ class by right-clicking the C++ file.
(because the ‘add button’ on the top left of the content drawer wasn’t active.)
but i cannot understand why ‘Mover’ class also comes to not work in the view?(after created ‘Grabber’ class)




스크린샷 2024-06-19 235505

Have you closed the editor and compiled using your IDE? Live coding should only be used if you’ve made changes to code outside of the header and constructor

1 Like

Another thing I experienced, was when the Grabber was first attached to the camera, it had an offset that placed it near the bottom of the capsule, so when I was trying to see the debug line, I couldn’t see it because the line was drawn outside of the view of the camera. I moved it up to center line of the camera, and it’s worked since then, though, sometimes you can’t see the line because it’s exactly center, so an offset can help if needed. Just make sure the Grabber isn’t trying to draw the debug line starting at your feet.

When you add a new class, it is always good practice to close Unreal once added and then build in your code editor. This wasn’t normally necessary but did happen with older versions of Unreal, really 5.1 and later with the Live coding enabled needs this more often.

So, once you create your class, close the UE editor and build. Then open UE and the class should be available to use.

The reason that Mover isn’t working is because the dynamic loading has gone wrong as a result of live coding and a fresh build should resolve it. Also, last resort and I’m sure you’ve seen this before, delete the binaries and intermediate folders in your project directory when the project is closed. Save that for the really problematic cases.

Another possibility is mover has had an error in the code introduced but live coding is failing to pick it up. It doesn’t happen very often but does happen.

thank you very much

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms