30-01-2023, 03:49 PM
(This post was last modified: 30-01-2023, 03:51 PM by josemendez.)
(30-01-2023, 03:37 PM)aderae Wrote: Hello!
I am using Obi Rope to make rope connections between physic objects. And anytime a new object is created, I am spawning a rope prefab and dynamically assigning Obi Particle Attachment components Target transforms to different physic objects. These objects are dynamic and can move to anywhere at anytime. Those attachments are set to static. However, when I spawn the prefab with solver as parent and the rope as child, rope starts with a huge back and forth swing eventually being dampened and goes back to normal function. However this bouncing takes around 8 seconds and looks glitchy. I am definitely doing something wrong here. How can I properly spawn a cable prefab and attach both ends to different transforms so they don't swing around just start like they used to function?
Sorry if it was too confusing.
Thanks!
Hi!
You can't spawn a single rope prefab and attach its ends to different transforms (let's call them transforms "A" and "B"), simply because the distance between A and B and the length/orientation of the cable prefab won't match: A might be 5 meters away from B, if your rope prefab is 3 meters long, you'll overstretch the rope by 2 meters, as the ends of the rope get "teleported" towards the transforms the rope will instantly gain a huge amount of kinetic energy and swing around like crazy. Or if A is 1 meter away from B, your 3 meters-long rope will instantly compress and then sag a lot.
What you want is to dynamically generate a rope of the correct length from transform A to transform B. You can do this by generating a rope blueprint at runtime, see "rope blueprints" in the manual's "scripting actors" section: http://obi.virtualmethodstudio.com/manua...ctors.html
kind regards,