|
|
Cannot make a rope with multiple control points |
Posted by: uatihb - 13-10-2023, 01:38 PM - Forum: Obi Rope
- Replies (1)
|
 |
Trying to setup a rope with variable thickness done by setting up multiple control points. Works in editor, until it doesn't. Can't really save it. Breaks the whole blueprint.
Obi 6.5.4
Unity 2021.3.22 & 2021.3.31
OS Ubuntu 20.04 & Windows 10
Quote:NullReferenceException: Object reference not set to an instance of an object
Unity.Collections.LowLevel.Unsafe.UnsafeUtility.WriteArrayElementWithStride[T] (System.Void* destination, System.Int32 index, System.Int32 stride, T value) (at /home/bokken/build/output/unity/unity/Runtime/Export/Unsafe/UnsafeUtilityPatched.cs:66)
Obi.ObiNativeList`1[T].set_Item (System.Int32 index, T value) (at Assets/ImportedAssets/Obi/Scripts/Common/DataStructures/NativeList/ObiNativeList.cs:64)
Obi.ObiActor.UpdateCollisionMaterials () (at Assets/ImportedAssets/Obi/Scripts/Common/Actors/ObiActor.cs:399)
Obi.ObiRope.SetupRuntimeConstraints () (at Assets/ImportedAssets/Obi/Scripts/RopeAndRod/Actors/ObiRope.cs:208)
Obi.ObiRope.OnValidate () (at Assets/ImportedAssets/Obi/Scripts/RopeAndRod/Actors/ObiRope.cs:178)
Quote:NullReferenceException: Object reference not set to an instance of an object
Unity.Collections.LowLevel.Unsafe.UnsafeUtility.WriteArrayElementWithStride[T] (System.Void* destination, System.Int32 index, System.Int32 stride, T value) (at /home/bokken/build/output/unity/unity/Runtime/Export/Unsafe/UnsafeUtilityPatched.cs:66)
Obi.ObiNativeList`1[T].set_Item (System.Int32 index, T value) (at Assets/ImportedAssets/Obi/Scripts/Common/DataStructures/NativeList/ObiNativeList.cs:64)
Obi.ObiActor.UpdateCollisionMaterials () (at Assets/ImportedAssets/Obi/Scripts/Common/Actors/ObiActor.cs:399)
Obi.ObiRope.SetupRuntimeConstraints () (at Assets/ImportedAssets/Obi/Scripts/RopeAndRod/Actors/ObiRope.cs:208)
Obi.ObiRope.OnValidate () (at Assets/ImportedAssets/Obi/Scripts/RopeAndRod/Actors/ObiRope.cs:178)
UnityEditor.SerializedObject:ApplyModifiedProperties(SerializedObject)
Obi.ObiRopeEditor:OnInspectorGUI() (at Assets/ImportedAssets/Obi/Editor/RopeAndRod/ObiRopeEditor.cs:124)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&) (at /home/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)
Quote:NullReferenceException: Object reference not set to an instance of an object
Unity.Collections.LowLevel.Unsafe.UnsafeUtility.ReadArrayElementWithStride[T] (System.Void* source, System.Int32 index, System.Int32 stride) (at /home/bokken/build/output/unity/unity/Runtime/Export/Unsafe/UnsafeUtilityPatched.cs:54)
Obi.ObiNativeList`1[T].get_Item (System.Int32 index) (at Assets/ImportedAssets/Obi/Scripts/Common/DataStructures/NativeList/ObiNativeList.cs:60)
Obi.ObiActor.GetParticlePosition (System.Int32 solverIndex) (at Assets/ImportedAssets/Obi/Scripts/Common/Actors/ObiActor.cs:682)
Obi.ObiPathSmoother.PathFrameFromParticle (Obi.ObiRopeBase actor, Obi.ObiPathFrame& frame, System.Int32 particleIndex, System.Boolean interpolateOrientation) (at Assets/ImportedAssets/Obi/Scripts/RopeAndRod/DataStructures/Path/ObiPathSmoother.cs:125)
Obi.ObiPathSmoother.GenerateSmoothChunks (Obi.ObiRopeBase actor, System.UInt32 smoothingLevels) (at Assets/ImportedAssets/Obi/Scripts/RopeAndRod/DataStructures/Path/ObiPathSmoother.cs:177)
Obi.ObiPathSmoother.Actor_OnInterpolate (Obi.ObiActor actor) (at Assets/ImportedAssets/Obi/Scripts/RopeAndRod/DataStructures/Path/ObiPathSmoother.cs:62)
Obi.ObiActor.Interpolate () (at Assets/ImportedAssets/Obi/Scripts/Common/Actors/ObiActor.cs:1221)
Obi.ObiSolver.Interpolate (System.Single stepTime, System.Single unsimulatedTime) (at Assets/ImportedAssets/Obi/Scripts/Common/Solver/ObiSolver.cs:1670)
Obi.ObiUpdater.Interpolate (System.Single stepDeltaTime, System.Single accumulatedTime) (at Assets/ImportedAssets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:132)
Obi.ObiFixedUpdater.Update () (at Assets/ImportedAssets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:66)
Quote:NullReferenceException: Object reference not set to an instance of an object
Obi.ObiRopeBlueprint+<Initialize>d__2.MoveNext () (at Assets/ImportedAssets/Obi/Scripts/RopeAndRod/Blueprints/ObiRopeBlueprint.cs:46)
Obi.ObiActorBlueprint+<Generate>d__59.MoveNext () (at Assets/ImportedAssets/Obi/Scripts/Common/Blueprints/ObiActorBlueprint.cs:282)
Obi.ObiActorBlueprint.GenerateImmediate () (at Assets/ImportedAssets/Obi/Scripts/Common/Blueprints/ObiActorBlueprint.cs:273)
UnityEngine.Events.InvokableCall.Invoke () (at /home/bokken/build/output/unity/unity/Runtime/Export/UnityEvent/UnityEvent.cs:178)
UnityEngine.Events.UnityEvent.Invoke () (at /home/bokken/build/output/unity/unity/Runtime/Export/UnityEvent/UnityEvent/UnityEvent_0.cs:58)
Obi.ObiPath.FlushEvents () (at Assets/ImportedAssets/Obi/Scripts/RopeAndRod/DataStructures/Path/ObiPath.cs:403)
Obi.ObiPathEditor.RemoveControlPointsMode (UnityEngine.Matrix4x4 matrix) (at Assets/ImportedAssets/Obi/Editor/RopeAndRod/ObiPathEditor.cs:195)
Obi.ObiPathEditor.OnToolGUI (UnityEditor.EditorWindow window) (at Assets/ImportedAssets/Obi/Editor/RopeAndRod/ObiPathEditor.cs:125)
UnityEditor.EditorTools.EditorToolManager.OnToolGUI (UnityEditor.EditorWindow window) (at /home/bokken/build/output/unity/unity/Editor/Mono/GUI/Tools/EditorToolManager.cs:454)
UnityEditor.SceneView.DefaultHandles () (at /home/bokken/build/output/unity/unity/Editor/Mono/SceneView/SceneView.cs:3156)
UnityEditor.SceneView.DoOnGUI () (at /home/bokken/build/output/unity/unity/Editor/Mono/SceneView/SceneView.cs:2414)
UnityEditor.SceneView.OnSceneGUI () (at /home/bokken/build/output/unity/unity/Editor/Mono/SceneView/SceneView.cs:2255)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:372)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:693)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:665)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:658)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:618)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:607)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/IMGUIContainer.cs:535)
UnityEngine.UIElements.EventDispatchUtilities.PropagateEvent (UnityEngine.UIElements.EventBase evt) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Events/IEventDispatchingStrategy.cs:113)
UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToRegularTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Events/MouseEventDispatchingStrategy.cs:35)
UnityEngine.UIElements.MouseEventDispatchingStrategy.SendEventToTarget (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.BaseVisualElementPanel panel) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Events/MouseEventDispatchingStrategy.cs:26)
UnityEngine.UIElements.MouseEventDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel iPanel) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Events/MouseEventDispatchingStrategy.cs:19)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:381)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:344)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:306)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:270)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:75)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:372)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/EventDispatcher.cs:222)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Panel.cs:420)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:468)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:211)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:74)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at /home/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:28)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at /home/bokken/build/output/unity/unity/Modules/IMGUI/GUIUtility.cs:189)
|
|
|
GetUnityCollider error cause errors in all instanses |
Posted by: alex798 - 10-10-2023, 02:10 PM - Forum: Obi Rope
- Replies (7)
|
 |
Hello dear developer,
I messed up ropeAttachment in one scene (target with obiCollider was inactive) and after I went to other scenes with normal ObiRopes it was still causing this error in ObiColliderBase-> UpdateIfNeeded-> GetUnityCollider == null.
Why it could be the case? (maybe U fixed this already - we didn't update lately)
|
|
|
Change obi rope attachment target realtime with script |
Posted by: Adammm - 06-10-2023, 03:26 PM - Forum: Obi Rope
- Replies (3)
|
 |
Hey! I was trying to change obi rope attachment the other day with script, and I couldn't make it happen. Whenever I do it manually in the inspector while playing the rope snaps to the new target position. But if I do it with script (just change the attachment script target to new transform), it changes the target but won't change the position nor do anything.
Can somebody help me with this and if fix the issue?
|
|
|
Proper way to delete a (Obi)Rigidbody (if there is one) |
Posted by: Lazerpants - 04-10-2023, 09:33 PM - Forum: Obi Rope
- Replies (2)
|
 |
Hello!
I have the rope set up in such a way where one spawns after the player character fires a bow at the ceiling, and when the arrow hits the ceiling, a rope extends downward, so that the character can climb up it. When the arrow hits the ceiling, everything spawns (solver, updater, renderer, etc.), along with a weight at the bottom of the rope so that the rope is always calm and held down as it gradually extends towards the ground. Everything works great and looks really good. Also I can do this pretty much as many times as I want (i.e. fire a bunch of arrows at the ceiling, one after another, and all of them spawn their own ropes with their own solvers and their own weights, etc. - no errors whatsoever).
Now I'm trying to change it so that there's only 1 rope at a time. When the player character fires another arrow at the ceiling, I want it to destroy the previous rope and then just make a new one in the new location. I'm using Unity's standard Destroy() method to destroy the rope parent (which has the solver and updater attached to it, then the rope itself which is a child, and the weight which is a separate object that's a child of the rope). Deleting the object throws no errors by itself. However, when I then go to shoot a new arrow to spawn a new rope, Unity starts throwing endless errors, which pertain to the Rigidbody of the weight object.
I'm assuming from the errors that the Obi code somewhere is trying to access/update the rigidbody that was attached to the weight at the bottom of the original rope, which has since been destroyed and no longer exists. Is there something I need to call first before destroying the rope, solver, and rigidbody so I can spawn the new rope without errors?
If I delete the old rope except for the weight with the rigidbody, then there are no errors. It's only when I delete the weight that it throws errors when I try to spawn a new rope. I'm assuming Obi has an internal list of rigidbodies it's trying to update when the new rope tries to spawn and I'm destroying them improperly.
Thank you in advance for your assistance.
|
|
|
How to add consintent speed/velocity to a rope? |
Posted by: lacasrac - 04-10-2023, 05:16 PM - Forum: Obi Rope
- Replies (1)
|
 |
I tried with this:
private void AddVelocityToRope(float scale)
{
var verticalActionValue = Input.GetAxisRaw("Vertical");
var shiftPressed = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift);
if (verticalActionValue != 0 && shiftPressed)
{
var downPressed = verticalActionValue < 0;
var s = 1;
if (downPressed) s = -1;
var bodyForward = _playerController.animator.bodyRotation * Vector3.forward * s;
//SetRopeInvMasses(1 / mass);
//igy egyenesebb a kotel mozgasa, mintha csak 1-et adnank at
for (var i = 0; i < rope.elements.Count; i++)
{
var addVelocity = (bodyForward * (scale * 10f * maxRopeVelocityScale)).ToVector4();
var v = solver.velocities[rope.elements[i].particle2];
if (v.magnitude <= _newDamping * 2) solver.velocities[rope.elements[i].particle2] += addVelocity * (Time.deltaTime * 10);
}
}
}
But I get not the desitred behaviour.
So how can I add a consistent velocity to all my particles?
+1: How can I ignore bigger velocities than a limit? Sometimes just the rope immediatelly get a big velocity I don't know why...and the rope is just jumping..
|
|
|
Adding particles to a softbody? |
Posted by: Henning - 04-10-2023, 11:26 AM - Forum: Obi Softbody
- Replies (2)
|
 |
Hi Obi team,
I am wondering if it is possible to manually / in scripts add particles to a softbody blueprint. Sometimes there are regions I would like to add details for better collision detection while the whole blueprint does not contain too many particles.
Also, is it possible to group particles in scripts? Manually selecting and creating groups is too time-consuming and they disappear once I regenerate the particles.
Thanks,
|
|
|
|