Help Barrier belt - changing length and moving anchors - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html) +--- Thread: Help Barrier belt - changing length and moving anchors (/thread-4423.html) |
Barrier belt - changing length and moving anchors - IceTrooper - 09-12-2024 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. 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) 2. Particles are not forming where the Rope length has been increased. You can see better in the screenshot what I mean. 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) 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 I need help with these problems described above. Maybe this can be written better using other APIs, if so I would welcome comments. RE: Barrier belt - changing length and moving anchors - josemendez - 10-12-2024 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, |