Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope moving in runtime
#2
(02-12-2024, 02:46 PM)Apoll0 Wrote: Hello!

I have a Rope with two static attachments on it's endings. 
I need to periodically show this rope in different places of the scene, between different objects in space. 
I use only one rope, simply turning it and it's attachments off and on when needed (by gameobject.setActive). The problem is that if you turn it on, pause for half a second, for example, and then move the attachments to the desired positions, then everything is ok, rope moves there it should be (with wild stretching, but ok). 

But if you turn it on and immediately give the attachments new positions, then the rope don't moves from its place.

What is the best way to move the attachments (these are ordinary empty Transforms) so that the rope immediately moves to the desired place and stays there until the next turn off?

Hi!

Attachments won't force the rope particles to move to a specific location, but attach them in the position they're in at the time of enabling the attachment as explained in the manual: http://obi.virtualmethodstudio.com/manua...ments.html

If you want to force  a specific attachment position, there's a code snippet in the manual that achieves just that: http://obi.virtualmethodstudio.com/manua...ments.html

(02-12-2024, 02:46 PM)Apoll0 Wrote: then everything is ok, rope moves there it should be (with wild stretching, but ok). 

Probably you'd want to Teleport() the rope (in addition to moving the attachments) to get rid of the stretching? Note that moving the transform of a rope has no effect on it while it's being simulated: you need to move its particles - which is what Teleport() does.

kind regards,
Reply


Messages In This Thread
Rope moving in runtime - by Apoll0 - 02-12-2024, 02:46 PM
RE: Rope moving in runtime - by josemendez - 02-12-2024, 02:55 PM
RE: Rope moving in runtime - by Apoll0 - 02-12-2024, 04:49 PM
RE: Rope moving in runtime - by josemendez - 03-12-2024, 02:10 PM
RE: Rope moving in runtime - by Apoll0 - 03-12-2024, 04:48 PM
RE: Rope moving in runtime - by josemendez - 03-12-2024, 05:31 PM