# UPhysicsConstraintComponent SetPositionTarget doesnt work

**URL:** <https://forums.unrealengine.com/t/uphysicsconstraintcomponent-setpositiontarget-doesnt-work/406839>\
**Category:** World Creation\
**Tags:** joints, unreal-engine, constraint, Physics, bug-report, question, CPP\
**Created:** [October 12, 2017, 10:19am UTC](https://forums.unrealengine.com/t/uphysicsconstraintcomponent-setpositiontarget-doesnt-work/406839 "2017-10-12T10:19:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RDaneelOlivaw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RDaneelOlivaw](https://forums.unrealengine.com/u/RDaneelOlivaw)\
**Post date:** [October 12, 2017, 10:19am UTC](https://forums.unrealengine.com/t/uphysicsconstraintcomponent-setpositiontarget-doesnt-work/406839/1 "2017-10-12T10:19:41Z")

</div>

It seems that when calling SetLinearVelocityTarget() works on Runtime, but for some reason the function **SetLinearPositionTarget** doesnt work when changed. Why is that? Whats the procedure to be able to change the Position Target so that a joint changes of position based on for example a key press or something in runtime?

For example , this doesnt work, but I dont know why, because when setting a position through the BP it moves to that position, but changing in runntime seems to not work? Is it buggy?

```
UPhysicsConstraintComponent* ConstraintComp = nullptr;
// This function updates the ConstrainComp with the value of the BP joint
UpdateConstraintComp_from_BluePrint();

float yaw;

    if (KeyNum1Pressed==1.0 && KeyNum2Pressed==0.0)
    {
        yaw = 90.0;
        FVector TargetOrientationFVector = FVector(yaw,0.0,0.0);
        UE_LOG(LogTemp, Warning, TEXT("yaw = %s"),*FString::SanitizeFloat(yaw));
        ConstraintComp->SetLinearPositionTarget(TargetOrientationFVector);

    }else if(KeyNum1Pressed==0.0 && KeyNum2Pressed==1.0)
    {
        yaw = -90.0;
        FVector TargetOrientationFVector = FVector(yaw,0.0,0.0);
        UE_LOG(LogTemp, Warning, TEXT("yaw = %s"),*FString::SanitizeFloat(yaw));
        ConstraintComp->SetLinearPositionTarget(TargetOrientationFVector);

    }else
    {
        yaw = 0.0;
    }

```

Has anybody used this and made it work?
