Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Replace pin constraint in runtime?
#2
(09-04-2018, 12:53 PM)Karlanton Wrote: I have a rope and at both ends there is a pin constraint to two different objects. After a 'event' i would like one of the pin constraints to be attached to a new object. How do i do this? i tried copying the code from the Grappling hook scene by doing this:

https://gyazo.com/df0ab0ef81ea4b37b709bb44f62ba535

Thanks in advance for any help!

Hi there,

You can remove the old constraint, then add a new one that uses the new object just like you are doing. However you must pass the index of a constraint to RemoveConstraint(), not the index of a particle. (i.e. If you only have one pin constraint added, you should pass "0" as the index).
Reply


Messages In This Thread
Replace pin constraint in runtime? - by Karlanton - 09-04-2018, 12:53 PM
RE: Replace pin constraint in runtime? - by josemendez - 10-04-2018, 10:13 AM