Lock Location and Rotation?

Hello i use the VR Template in 4.15

My question is how i can Lock Location and Rotation except for one direction?

I want if i hold in hand a Billiard Cue lock this so that you can move the stick only in shock direction!

I hope you understand what I mean

Direction is a simple vector. If you know, for example, rotation of your hand, or rotation or Cue itself, you can get its direction by getting some of its vectors.


Then you need to implement its movement according to its direction vector. For example:

Location = CurrentLocation + MovementDistance * DirectionVector

where MovementDistance is simple float value which means distance you want to move this object in current moment.

can you explain this in more detail with an example?

I’m still looking for a solution

You can use Clamp Axis and Clamp Vector if you are using Blueprint or the FVector::Clamp & FRotator::Clamp function for C++.

can you show me an example how to use this?