I have a problem where when I build my game in the standalone version. It behaves differently then when I am working on it in the editor. The issue come at a part in my game where you can shoot hooks that lock onto other objects and allow you to drag them. In the editor it behaves fine, but in the standalone version I shoot the hook and it just bounces off the object.
The code is supposed to create a fixed joint between the two objects. I use a raycast to find the object I clicked on and then take the hook that will be shot at the target and add a fixed joint component, then finally I add the target object to the hooks fixed joint component. When you let go the fixed joint is deleted.
In the log it says that “NullReferenceException: Object reference not set to an instance of an object” but I don’t understand how it can work in the editor but in the build it gives me an error.
Any help is appreciated thanks.