Making Player look at part while moving

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

     I want my character to face a part with their torso going up and down based 
     on the target's height. This system must work while character moves. Kind of 
     like when a player aims with a gun in the game Isle.
    
  2. What is the issue? Include screenshots / videos if possible!

    Every method for a character looking at something breaks when the character
    moves, It just teleports the person back again, and again.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

looked at the developer hub for a few hours, found nothing.

I have tried CFrame and .Orientation and various peices of code for looking at things

Have you tried using an IKControl inside the player’s character?

what’s a IK control? I’ve never heard of such a topic. Could you please provide an example. The link you gave me really doesn’t have much information. No wonder the topic is so vauge. This seems more like something moving only one part of a rig.

Could someone please explain a Ik constraint and provide a similar example to mine?

An IKControl can be placed inside of the humanoid of the character and it will make the EndEffector (set in the IKControl’s properties) move towards and/or look at the target (also set in the properties). You can also set a ChainRoot which limits which parts of the character can move.

For example, if the EndEffector was the Head, the Target was a part, and the ChainRoot was the LowerTorso, all the parts above the LowerTorso would move so that the Head can move towards the part.

Here is a video of the example I described:

You could also set the Type property to LookAt for what you are trying to achieve for a better result.

IKControl can be a good method as it will automatically update when the Character and/or Target move without any additional code. In addition, it can also work with animations.

Hope this helps :slight_smile:

My ik control makes the character tilt to the sides and all kinds of other wonky things whenever I use either torso, and the other body parts don’t help. Could you please tell me which one to use for this smoothness. And maybye some other tips.

I would recommend setting the EndEffector to the Head, the Target to the part and the ChainRoot to the Torso. In addition, I would set the Type to LookAt.

If the head still behaves strangely, you could try using Constraints; however, I am not very familiar with how they work.

Also, If I wanted to make it look to the left or right of my target, what would I do? Like by a certian amount of degrees.

Appearently there is something called Endeffector offset, how do I change it?

You could try placing an attachment inside of the part and setting the target to the attachment to offset it.

I tried, but it was buggy. could you look into what I said? also, I would need to position the attachment further away if I wanted the character to do it from a further distance.