Ghoul Not Turning In Direction

Hello all! I’ve been looking through a tutorial and I can’t quite wrap my mind around the fact that the
enemy spatial does not turn in the player’s direction after being sensed. It just looks in one direction and does its running in one direction BUT the spatial does come after the player it just…looks in one direction and does all its controls in one direction such as: attacking, sprinting, and walking. Here’s the code for lookAt:

else if (sprinting)
		{
			if (!animChannel.getAnimationName().equals("run"))
			{
				animChannel.setAnim("run");
				sprintStartTime = stage.getTime();
			}
			
			Vector3f move = target.getLocation().subtract(getLocation());
			move.setY(0);
			move.set(move.normalize());
			control.applyCentralForce(move.mult(sprintForce));
			
			Vector3f targetZero = target.getLocation();
			targetZero.setY(getLocation().getY());
			model.lookAt(targetZero, Vector3f.UNIT_Y);
			
			if (stage.getTime() - sprintStartTime > sprintDuration)
			{
				sprinting = false;
				animChannel.setAnim("walk");
			}

It has something to do with these bits of code though:


                        Vector3f targetZero = target.getLocation();
			targetZero.setY(getLocation().getY());
			model.lookAt(targetZero, Vector3f.UNIT_Y);
			
			if (toTarget.length() < attackStartDistance && stage.getTime() - attackTime > reAttackTime)
				attacking = true;
			
			if (toTarget.length() > sprintStartDistance && stage.getTime() - sprintStartTime > sprintRecharge)
				sprinting = true;
		}

I took a second look at the whole Ghoul page and I feel like I’m supposed to move the lookAt code inside one of these if statements. It has something to do with the structure.

It seems to me that the targetZero vector should be relative to the ghoul’s position, just like the move vector. As it is now, it should be looking in the direction that the target is located relative to zero (or whatever translation the scene has).

I also got another question about the Ray class. Why does my crosshair slightly position itself to the top right corner of my screen when I set it up. Theres nothing wrong with the code…have you had that problem before?