# Set Constraint Reference nodes explanation?!

**URL:** <https://forums.unrealengine.com/t/set-constraint-reference-nodes-explanation/350034>\
**Category:** Editor Scripting\
**Tags:** frame, orientation, reference, position, physics-constraint, unreal-engine, question\
**Created:** [March 9, 2016, 2:25pm UTC](https://forums.unrealengine.com/t/set-constraint-reference-nodes-explanation/350034 "2016-03-09T14:25:24Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nicat](https://forums.unrealengine.com/u/Nicat)\
**Post date:** [March 9, 2016, 2:25pm UTC](https://forums.unrealengine.com/t/set-constraint-reference-nodes-explanation/350034/1 "2016-03-09T14:25:24Z")

</div>

For the love of God. Can someone explain how to use those 3 nodes please? I am going nuts here… Set Constraint Reference Frame/Orientation/Position how on earth can I use these?? 2 people have asked about this and ZERO answer was given(one of them got banned for rudeness I guess)… does everyone else know how to use them besides me? Or is it some sacred matter which should not be discussed in public?! Please someone at least give a direction towards the answer if you know ☹ I have tried reading source code but still have no freaking idea about how to use it properly D: And yes I need to use it, because I see what it changes. But it is almost impossible to understand how to use it properly. It… it just doesn’t make sense: Primary axis?? Secondary axis? what? O.o

---

<div class="post-metadata">

**Author:** ![Sentura](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sentura](https://forums.unrealengine.com/u/Sentura)\
**Post date:** [March 10, 2016, 12:28am UTC](https://forums.unrealengine.com/t/set-constraint-reference-nodes-explanation/350034/2 "2016-03-10T00:28:02Z")

</div>

> **[Set Constraint Reference Position](https://docs.unrealengine.com/4.27/en-US/BlueprintAPI/Physics/Components/PhysicsConstraint/SetConstraintReferencePosition/)**
>
> Set Constraint Reference Position

---

<div class="post-metadata">

**Author:** ![Nicat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nicat](https://forums.unrealengine.com/u/Nicat)\
**Post date:** [March 10, 2016, 8:08am UTC](https://forums.unrealengine.com/t/set-constraint-reference-nodes-explanation/350034/3 "2016-03-10T08:08:10Z")

</div>

It is no different from what is written in engine. I think have made my question clear, it is: how to use them? Not what they do. For example, if you change PriAxis and SecAxis in Set Constraint Reference Orientation you will see some kind of change in rotation of object but I have no idea how it changes rotation based on two vectors. I hope this makes my question even more clear.  
Thanks for help 🙂  
I guess this question will also get lost in the dark void of ConstraintReference world ☹

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e3515d22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e3515d22](https://forums.unrealengine.com/u/anonymous_user_e3515d22)\
**Post date:** [May 23, 2016, 7:21pm UTC](https://forums.unrealengine.com/t/set-constraint-reference-nodes-explanation/350034/4 "2016-05-23T19:21:57Z")

</div>

Nicat, did you figure this out? The reference position is working as expected (just an offset from the frame’s matrix). But the orientation is mind boggling. I’m getting unexplained results.

---

<div class="post-metadata">

**Author:** ![Nicat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nicat](https://forums.unrealengine.com/u/Nicat)\
**Post date:** [May 23, 2016, 8:41pm UTC](https://forums.unrealengine.com/t/set-constraint-reference-nodes-explanation/350034/5 "2016-05-23T20:41:03Z")

</div>

I kind of understood “Set Constraint Reference Frame/Position” but I gave up and has been working on something else. I’ll get back to it later.  
I couldn’t even get close to getting close to understanding “Set Constraint Reference Orientation” :\

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e3515d22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e3515d22](https://forums.unrealengine.com/u/anonymous_user_e3515d22)\
**Post date:** [May 23, 2016, 8:47pm UTC](https://forums.unrealengine.com/t/set-constraint-reference-nodes-explanation/350034/6 "2016-05-23T20:47:20Z")

</div>

I think I figured it out. Pri Axis is the X axis, and Sec Axis is the Y axis. Given those two, the Z can be computed internally. I use Make Rotator and then get its Forward Vector and Right Vector, and plug those into Set Constraint Reference Orientation, where Pri Axis = Forward Vector, and Sec Axis = Right Vector. Then, I can simply plug values into the Rotator’s Roll, Pitch, and Yaw to orient the constraint relative to the frame of reference it’s attached to.

---

<div class="post-metadata">

**Author:** ![Nicat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nicat](https://forums.unrealengine.com/u/Nicat)\
**Post date:** [May 23, 2016, 9:06pm UTC](https://forums.unrealengine.com/t/set-constraint-reference-nodes-explanation/350034/7 "2016-05-23T21:06:42Z")

</div>

Wow that was fast. I think I understood what you mean. If it really is like that, then I would like to find out why those are called Pri/Sec Axis instead of Forward/Right Vector.  
Btw doesn’t it work same as “Set…Frame” node’s “Ref Frame Rotation”?  
I’ll give it a try tomorrow as I’m extremely tired right now. Hopefully I can use that node… finally. Thank you for letting know 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e3515d22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e3515d22](https://forums.unrealengine.com/u/anonymous_user_e3515d22)\
**Post date:** [May 23, 2016, 9:42pm UTC](https://forums.unrealengine.com/t/set-constraint-reference-nodes-explanation/350034/8 "2016-05-23T21:42:52Z")

</div>

Do you mean the “Set Constraint Reference Frame” node? That node takes a “Ref Frame” parameter, which is just a UE4 Transform (including translation, rotation, and scale).

---

<div class="post-metadata">

**Author:** ![Nicat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nicat](https://forums.unrealengine.com/u/Nicat)\
**Post date:** [May 23, 2016, 9:58pm UTC](https://forums.unrealengine.com/t/set-constraint-reference-nodes-explanation/350034/9 "2016-05-23T21:58:47Z")

</div>

Yeah that is what I mean. If I remember correctly changing “Ref Frame Rotation” changes the rotation of reference. I mean, if I use “Angular Orientation Drive” after changing “Ref Frame Rotation” orientation will change relative to “Ref Frame Rotation”.  
However, I might be remembering it wrong. I have bad memory 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e3515d22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e3515d22](https://forums.unrealengine.com/u/anonymous_user_e3515d22)\
**Post date:** [May 23, 2016, 10:07pm UTC](https://forums.unrealengine.com/t/set-constraint-reference-nodes-explanation/350034/10 "2016-05-23T22:07:08Z")

</div>

That may be, but I haven’t tried using the angular drive after modifying the frame rotation. But AFAIK, Set Constraint Reference Frame is just a shortcut for setting both Ref Pos and Ref Orientation at the same time.

---

<div class="post-metadata">

**Author:** ![Nicat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nicat](https://forums.unrealengine.com/u/Nicat)\
**Post date:** [May 23, 2016, 10:20pm UTC](https://forums.unrealengine.com/t/set-constraint-reference-nodes-explanation/350034/11 "2016-05-23T22:20:55Z")

</div>

I think so too. But I really want to know why on earth those are called Pri Axis and Sec Axis, it is bugging me.  
I feel like we are still missing something important about the mystery of “Set Constraint Reference…” node :\

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e3515d22](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e3515d22](https://forums.unrealengine.com/u/anonymous_user_e3515d22)\
**Post date:** [May 23, 2016, 10:26pm UTC](https://forums.unrealengine.com/t/set-constraint-reference-nodes-explanation/350034/12 "2016-05-23T22:26:15Z")

</div>

Yeah, not sure about that. Maybe because PhysX is a cross-platform physics system, and different platforms use different axis systems. Not sure, though.

---

<div class="post-metadata">

**Author:** ![Nicat](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nicat](https://forums.unrealengine.com/u/Nicat)\
**Post date:** [November 30, 2016, 8:51am UTC](https://forums.unrealengine.com/t/set-constraint-reference-nodes-explanation/350034/13 "2016-11-30T08:51:09Z")

</div>

As **sranck** said:

_I think I figured it out. Pri Axis is the X axis, and Sec Axis is the Y axis. Given those two, the Z can be computed internally. I use Make Rotator and then get its Forward Vector and Right Vector, and plug those into Set Constraint Reference Orientation, where Pri Axis = Forward Vector, and Sec Axis = Right Vector. Then, I can simply plug values into the Rotator’s Roll, Pitch, and Yaw to orient the constraint relative to the frame of reference it’s attached to._

Pri Axis is Forward vector, Sec Axis is Right vector of frame.
