Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Cloning A Rope Exactly
#1
Hello.

I want help about cloning a rope in runtime. I have a rope attached to player's hand. I need to clone it exactly with old one, with positions of particles i meant. Old one will be stay in game for 5-6 seconds, new one will be new rope of the hand. And old rope vs new rope shouldn't collide so I have made layer matrix settings. I have used saving state and load immediately, but there are also some obstacles in map, rope may go through the walls, I am really stucked.

Result : https://streamable.com/digvso

Save/Load script : 

Code:
public ObiActorBlueprint Save()
   {
       ObiActorBlueprint state2 = Instantiate(rope.blueprint);
       rope.SaveStateToBlueprint(state2);
       return state2;
   }

   public void Load(ObiActorBlueprint state3)
   {
       rope.ropeBlueprint = (ObiRopeBlueprint)state3;
   }


Thank you.
Reply
#2
Hi there,

In answered to your PM. However, I don't understand what's going on in the video you posted here. I assume you're saving the rope state at some point in time (when the character arrives at the sofa?) and then loading it.

If the copy is done correctly, and the original rope does not intersect walls/furniture, the copy shouldn't either (after all, particle positions are copied from the original rope). Note that if the original rope insterects something, the copy will too.

Quote:new rope shouldn't collide so I have made layer matrix settings

Obi does not use layer matrix to filter out collisions, as checking the matrix for each collision would be really inefficient when you have several thousands of contacts each frame (and in a particle system, you do). It uses phases instead. Particles/collider with the same phase will ignore each other. If they have different phases, they will collide with each other. See:
http://obi.virtualmethodstudio.com/tutor...sions.html
Reply