- Home /
Adding constraint component at runtime
Ist there a way to add a constraint component in code after a GameObject was instantiated? Or is there a way to modifier an already attrached constraint component without using the inspector mode?
Answer by hectorux · Jun 28, 2018 at 11:12 PM
yes, all the variables in the inspector you can refrence them via script using the constrint.variant you want = your thing you want there, see https://docs.unity3d.com/ScriptReference/Rigidbody-constraints.html
The OP is not asking about Rig.constraints they are asking about constraint components such as ParentConstraint. This answer is referring to the Rig component's variables...
Your answer
![](https://koobas.hobune.stream/wayback/20220612165702im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Turn on Specific Axis Constraints - Keeping Others Selected (JS) 1 Answer
Caterpillar mechanics in unity.. 'make spheres follow' 0 Answers
Attempt to disable constraints using RigidbodyConstraints.None has no effect 0 Answers
How to call a string inline as part of identifier of a new string? 1 Answer
[Unity5] Performance and functions 3 Answers