Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  How do you create a rope at runtime?
#2
(30-03-2022, 10:51 PM)NailEngine Wrote: I am trying to create a rope at runtime with a static attachment and a dynamic attachment. Much like the chain example. There is an example script called "RuntimeRopeGenerator" that looked promising, but has been completely commented out -- it looks like it's probably deprecated. Where can I find an example of how to create a rope purely from code?

Just to be clear -- I am trying to create a rope without having to create a blueprint asset in-editor; I am attempting to do everything from code.

Hi there!

The manual explains how, along with sample code:
http://obi.virtualmethodstudio.com/manua...ctors.html

You also have an example included with the asset, the "RopeGrapplingHook" sample scene uses an entirely procedural rope. Check out the /Obi/Samples/RopeAndRod/SampleResources/Scripts/GrapplingHook.cs script, and ..../ExtendableGrapplingHook.cs for a version that extends itself over time instead of appearing instantly.

The steps to create a rope from code are conceptually the same you follow to create a rope in-editor:

Blueprint:
- Create a rope blueprint.
- Add control points to the blueprint to define the rope's shape.
- Call the blueprint's Generate() coroutine.

Rope:
- Create a ObiRope component and any renderer you wish (extruded/chain/line/mesh)
- Assign the blueprint to the rope.
- Put the rope into a solver (if you haven't got any solver around, you will need to create one).
Reply


Messages In This Thread
RE: How do you create a rope at runtime? - by josemendez - 31-03-2022, 07:49 AM