Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Creating obi rope prefab
#1
Hi there,
I tried to search the forum for solution to my issue but the forum is huge so I am posting this
I am facing an issue with creating unity prefab that include obi rope with 'obi rope mesh renderer' component, the problem is that each time I try to apply the 'deformedMesh' in the 'Mesh Filter' component to the prefab I get the following message:
"a reference to an object in the scene can't be applied to the prefab asset", and as a result when I try to instantiate the prefab in runtime the rope doesn't appear, I have tried to search for the deformedMesh asset but I didn't find it in the project or the scene please help me to resolve this issue as this is essential for my project, thanks in advance
Reply
#2
(02-12-2020, 08:17 PM)amismail Wrote: Hi there,
I tried to search the forum for solution to my issue but the forum is huge so I am posting this
I am facing an issue with creating unity prefab that include obi rope with 'obi rope mesh renderer' component, the problem is that each time I try to apply the 'deformedMesh' in the 'Mesh Filter' component to the prefab I get the following message:
"a reference to an object in the scene can't be applied to the prefab asset", and as a result when I try to instantiate the prefab in runtime the rope doesn't appear, I have tried to search for the deformedMesh asset but I didn't find it in the project or the scene please help me to resolve this issue as this is essential for my project, thanks in advance

The rope’s “deformableMesh” is created entirely at runtime. Its not an asset or part of a scene, so it can’t be applied to a prefab or replaced by another mesh.

What’s your use case? If you want to use a custom mesh for the rope, you should use ObiRopeMeshRenderer instead. The extruded renderer generates its own mesh by extruding a rope section, as explained in the manual.
Reply
#3
(02-12-2020, 09:02 PM)josemendez Wrote: The rope’s “deformableMesh” is created entirely at runtime. Its not an asset or part of a scene, so it can’t be applied to a prefab or replaced by another mesh.

What’s your use case? If you want to use a custom mesh for the rope, you should use ObiRopeMeshRenderer instead. The extruded renderer generates its own mesh by extruding a rope section, as explained in the manual.
I am actually using ObiRopeMeshRenderer as you mentioned but it also create the deformableMesh also so it is the same problem, Is there a way to use the ObiRopeMeshRenderer in a prefab and if not what is the alternative
Reply
#4
(04-12-2020, 06:35 PM)amismail Wrote: I am actually using ObiRopeMeshRenderer as you mentioned but it also create the deformableMesh also so it is the same problem, Is there a way to use the ObiRopeMeshRenderer in a prefab and if not what is the alternative

Hi,

It should work with prefabs out of the box with either renderer. Can you give more details about you ise case, or some steps that lead to error you describe?
Reply
#5
(04-12-2020, 09:42 PM)josemendez Wrote: Hi,

It should work with prefabs out of the box with either renderer. Can you give more details about you use case, or some steps that lead to error you describe?
Reply
#6
I will try to create a sample scene and upload it to demonstrate the issue
Reply
#7
The project is large I couldn't upload, but I have taken a snapshot showing the issue, it shows 2 prefabs, the first is added before runtime and the other is instantiated at runtime, the first shows the rope mesh as intended but the second (the one instantiated at runtime) doesn't show the rope mesh, please advice 

    The project is large I couldn't upload, but I have taken a snapshot showing the issue, it shows 2 prefabs, the first is added before runtime and the other is instantiated at runtime, the first shows the rope mesh as intended but the second (the one instantiated at runtime) doesn't show the rope mesh, please advice 
Reply
#8
Hi there,
Any help I am Stuck in this issue
Reply
#9
(10-12-2020, 11:37 AM)amismail Wrote: Hi there,
Any help I am Stuck in this issue

Hi,

I'm still unable to reproduce this. Tried in a variety of Unity versions, instantiating both at runtime and from editor, but it works perfectly for me. The rope prefab is simulated and rendered fine.

Just a sanity check: you're instantiating the rope under a solver component, right? If you are instantiating it anywhere else in the scene, simulation and rendering won't be updated. It is required for all actors to have a parent solver as explained in the manual:

http://obi.virtualmethodstudio.com/tutor...cture.html
http://obi.virtualmethodstudio.com/tutor...ctors.html
Reply
#10
(10-12-2020, 12:55 PM)josemendez Wrote: Hi,

I'm still unable to reproduce this. Tried in a variety of Unity versions, instantiating both at runtime and from editor, but it works perfectly for me. The rope prefab is simulated and rendered fine.

Just a sanity check: you're instantiating the rope under a solver component, right? If you are instantiating it anywhere else in the scene, simulation and rendering won't be updated. It is required for all actors to have a parent solver as explained in the manual:

http://obi.virtualmethodstudio.com/tutor...cture.html
http://obi.virtualmethodstudio.com/tutor...ctors.html
I am Uploading the sample project to dropbox and will share the link with you as soon as it finishes

https://www.dropbox.com/s/ul02ztrm32rkb9...t.zip?dl=0

Here is the link, I hope it is solved quickly thanks in advance
Reply