Grenade with line renderer errors?

m3nth0l

New member
Using latest UCC with 2018.3.7f1 and have a throwable grenade on my character. Things blow up as they should. Then I added the trajectory / line render component per the docs and my console vomits errors all over. The line render is working, but for the life of me I can't figure out the cause of these errors. Everything is working good in the demo scene, and I also tried to match all demo scene component values. It's got to be something I've got wrong or missed somewhere... Game runs great, but as soon as I aim, the errors start rolling, but I can still see the line renderer and throw the grenade as expected. Any ideas?

Edit: It doesn't matter that this is a run time pickup does it? Cause it is...

StackOverflowException
UnityEngine.Transform.get_lossyScale () <0x5cd52420 + 0x0006a> in <ddf1b6b8983d46ce84146e6e1ef5a65d>:0
Opsive.UltimateCharacterController.Utility.MathUtility.CapsuleColliderHeightMultiplier (UnityEngine.CapsuleCollider capsuleCollider) (at Assets/3rd Party/Opsive/UltimateCharacterController/Scripts/Utility/MathUtility.cs:391)
Opsive.UltimateCharacterController.Utility.MathUtility.CapsuleColliderEndCaps (UnityEngine.CapsuleCollider capsuleCollider, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, UnityEngine.Vector3& firstEndCap, UnityEngine.Vector3& secondEndCap) (at Assets/3rd Party/Opsive/UltimateCharacterController/Scripts/Utility/MathUtility.cs:140)
Opsive.UltimateCharacterController.Objects.TrajectoryObject.SingleCast (UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, UnityEngine.Vector3 direction) (at Assets/3rd Party/Opsive/UltimateCharacterController/Scripts/Objects/TrajectoryObject.cs:608)
Opsive.UltimateCharacterController.Objects.TrajectoryObject.Move (UnityEngine.Vector3& position, UnityEngine.Quaternion rotation) (at Assets/3rd Party/Opsive/UltimateCharacterController/Scripts/Objects/TrajectoryObject.cs:522)
Opsive.UltimateCharacterController.Objects.TrajectoryObject.SimulateTrajectory (UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, System.Collections.Generic.List`1[T] positions, System.Int32 positionsSkip) (at Assets/3rd Party/Opsive/UltimateCharacterController/Scripts/Objects/TrajectoryObject.cs:271)
Opsive.UltimateCharacterController.Objects.TrajectoryObject.SimulateTrajectory (UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, System.Collections.Generic.List`1[T] positions, System.Int32 positionsSkip) (at Assets/3rd Party/Opsive/UltimateCharacterController/Scripts/Objects/TrajectoryObject.cs:273)

StackOverflowException
UnityEngine.Transform.get_lossyScale () <0x5cd52420 + 0x0006a> in <ddf1b6b8983d46ce84146e6e1ef5a65d>:0
Opsive.UltimateCharacterController.Utility.MathUtility.CapsuleColliderHeightMultiplier (UnityEngine.CapsuleCollider capsuleCollider) (at Assets/3rd Party/Opsive/UltimateCharacterController/Scripts/Utility/MathUtility.cs:391)
Opsive.UltimateCharacterController.Utility.MathUtility.CapsuleColliderEndCaps (UnityEngine.CapsuleCollider capsuleCollider, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, UnityEngine.Vector3& firstEndCap, UnityEngine.Vector3& secondEndCap) (at Assets/3rd Party/Opsive/UltimateCharacterController/Scripts/Utility/MathUtility.cs:140)
Opsive.UltimateCharacterController.Objects.TrajectoryObject.SingleCast (UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, UnityEngine.Vector3 direction) (at Assets/3rd Party/Opsive/UltimateCharacterController/Scripts/Objects/TrajectoryObject.cs:608)
Opsive.UltimateCharacterController.Objects.TrajectoryObject.Move (UnityEngine.Vector3& position, UnityEngine.Quaternion rotation) (at Assets/3rd Party/Opsive/UltimateCharacterController/Scripts/Objects/TrajectoryObject.cs:522)
Opsive.UltimateCharacterController.Objects.TrajectoryObject.SimulateTrajectory (UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, System.Collections.Generic.List`1[T] positions, System.Int32 positionsSkip) (at Assets/3rd Party/Opsive/UltimateCharacterController/Scripts/Objects/TrajectoryObject.cs:271)
Opsive.UltimateCharacterController.Objects.TrajectoryObject.SimulateTrajectory (UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, System.Collections.Generic.List`1[T] positions, System.Int32 positionsSkip) (at Assets/3rd Party/Opsive/UltimateCharacterController/Scripts/Objects/TrajectoryObject.cs:273)
 
Last edited:
That looks like a Unity error.. getting the lossyScale is causing some a stack overflow. Double check that all of your scales are correct. Beyond that if you can reproduce it in a small demo scene I would report it to Unity. The runtime pickup aspect shouldn't matter.
 
Hi, I'm having this same error, when I grenade equipped and aim.

StackOverflowException
UnityEngine.Transform.get_lossyScale () <0x3ab3c800 + 0x0006a> in <712d4fd831e148f0ba5124a22b81cac4>:0

Also I can't see trajectory and noticed lag while aiming.
What is the fix for this error?
 
Last edited:
I couldn't duplicate it in a new project with nolan, so my fix was to just disable the renderer for now. I triple checked all my scale settings, and couldn't find the issue. Figured I'd come back to it once I replace the placeholder assets I'm using and try again. If you do come up with a fix, let me know.
 
If one of you can report that bug to Unity that would be great - getting the lossy scale shouldn't ever cause a stack overflow to occur.
 
Took another look at this tonight. I found that changing the Trajectory object component under Impact > Bounce Mode to None as opposed to the default setting of Reflect cleared the stack overflow error, and multiple subscription notices. All is working as it should for me. I must have overlooked the fact that Nolan had this set to none as well, and was unable to break the demo scene by changing to Reflect for Nolan.

@bluebird hope this will fix your issue as well!
 
Hey There, I had this error too and this is how I solved it: In grenade Item, under the ThirdPerson Throwable Item Properties component, Trajectory location prefab is null by default. After I assign the location, the problems just solved. It may be help someone.
 
I was also see a stack overflow with throwables. For me it was in TrajectoryObject.SimulateTrajectory when an item was using reflect but didn't have a sphere/capsule collider (was using a box). The trajectory object was setup with a very large number of segments and at the point in the trajectory the object comes to rest, the movement raycast doesn't move the position any and the recursive call goes infinite. I was able to work around it with by skipping the call if Move doesn't change the position, but there might be a better way to address it.
 
Top