Grannyboy
Active member
Im trying to make a throwable weapon but as soon as I add the trajectory script and a line renderer unity craches. I get some allocation errors spamming my console and crashing the editor:
I asked chatGPT and got this answer:
The error message suggests that the operation you are trying to perform has caused a stack overflow. In programming, a stack overflow occurs when a function or operation consumes more memory than the stack has available. This can happen when there is a recursive function that calls itself too many times or when there is an infinite loop.
In your case, the error seems to be related to the Ultimate Character Controller from Opsive. Specifically, it seems to be coming from the TrajectoryObject script. The error message indicates that the SimulateTrajectory method is being called repeatedly, and this is causing a stack overflow.
To fix this issue, you may want to review the code in the SimulateTrajectory method and look for any recursive calls or infinite loops. If you are not familiar with the code, you may want to contact the developer or look for support forums related to the Ultimate Character Controller. It's possible that this is a known issue that has already been addressed in a newer version of the software.
Additionally, you may want to check if your Unity version is up to date and if your system meets the minimum hardware requirements. Sometimes, insufficient hardware or outdated software can cause unexpected errors.
If the issue persists after trying these steps, you may want to seek further assistance from Unity support or a community forum.
My weapon is set up similar to the Opsive prebuild Grenade and I can see the line renderer render a trajectory before the editor freezes and chrashes. What could possibly cause this and does anyone else face the same problems?
I asked chatGPT and got this answer:
The error message suggests that the operation you are trying to perform has caused a stack overflow. In programming, a stack overflow occurs when a function or operation consumes more memory than the stack has available. This can happen when there is a recursive function that calls itself too many times or when there is an infinite loop.
In your case, the error seems to be related to the Ultimate Character Controller from Opsive. Specifically, it seems to be coming from the TrajectoryObject script. The error message indicates that the SimulateTrajectory method is being called repeatedly, and this is causing a stack overflow.
To fix this issue, you may want to review the code in the SimulateTrajectory method and look for any recursive calls or infinite loops. If you are not familiar with the code, you may want to contact the developer or look for support forums related to the Ultimate Character Controller. It's possible that this is a known issue that has already been addressed in a newer version of the software.
Additionally, you may want to check if your Unity version is up to date and if your system meets the minimum hardware requirements. Sometimes, insufficient hardware or outdated software can cause unexpected errors.
If the issue persists after trying these steps, you may want to seek further assistance from Unity support or a community forum.
My weapon is set up similar to the Opsive prebuild Grenade and I can see the line renderer render a trajectory before the editor freezes and chrashes. What could possibly cause this and does anyone else face the same problems?