Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Barrier belt - changing length and moving anchors
#1
Pregunta 
Hey, I would like to, in my VR app, make a barrier belt, like in cinemas at the box office or airports to cordon off aisles.

[Image: AIG2730470.jpg]





This is my script that I made along the lines of a similar script I found in examples (grapling hook) (I cannot post it in the message because of error)
https://pastebin.com/sC54e9fh





I noticed three main problems:


1.  A visual bug, as if the UV scale increases indefinitely. I have no idea what this could be. (video in attachments)






[Image: 2tIK7eT.png]






[Image: PxpYDYM.png]






[Image: HmqTk1Q.png]







[Image: eW9CFzY.png]




2. Particles are not forming where the Rope length has been increased. You can see better in the screenshot what I mean.




[Image: U0eUoRo.png]






3. When I move an object quickly in the editor, the Obi Particle Attachment doesn't seem to keep up. Does this problem only occur in the editor? Is there any way to improve it? (video in attachments)




[Image: kDJeZq4.png]






4. When I select the ‘Roll-Out Rope’ object on the hierarchy then I get a spam on the console:



Code:
Look rotation viewing vector is zero

UnityEngine.Quaternion:LookRotation (UnityEngine.Vector3)

Obi.ObiRopeCursorEditor:DrawGizmos (Obi.ObiRopeCursor,UnityEditor.GizmoType) (at Assets/Obi/Editor/RopeAndRod/ObiRopeCursorEditor.cs:91)

UnityEngine.GUIUtility:ProcessEvent(int,intptr,bool&).





I need help with these problems described above. Maybe this can be written better using other APIs, if so I would welcome comments. Sonrisa
Reply
#2
Hi,

Problems 1,2 and 3 all stem out from improper cursor placement: both your cursor's mu and source mu are set to zero, which means the cursor is copying the first particle in the rope (the one attached to the start of the barrier) and then placing the copy on top of the original particle. So it's essentially creating many attached particles, all on top of each other.

This will cause UVs to stretch weirdly across the rope, no particles to be created along the rope (because they're all created on top of each other at the start of the rope) and the "look rotation viewing vector is zero" warning (since the vector pointing from one particle to the next is zero as they're exactly on top of each other).

Set your cursor's mu and source mu to something else than zero. You probably want to insert particles a bit after the start of the rope.


Code:
When I move an object quickly in the editor, the Obi Particle Attachment doesn't seem to keep up. Does this problem only occur in the editor? Is there any way to improve it?

Objects in the editor are moved in Update(), ropes are simulated in FixedUpdate(). So during frames where there's no call to FixedUpdate, the rope will lag behind the object. Typically you want to perform all physics-related logic during FixedUpdate.

Moreover, by default Obi uses asynchronous simulation which adds a 1 frame delay between input and simulation for performance reasons. You may want to switch the ObiSolver's synchronization mode to "Synchronous" or "Synchronous Fixed" in some cases. The manual contains an in-depth explanation of how fixed timestepping works in Unity and the different ways Obi can be bolted onto it.

kind regards,
Reply