Hello,
I created a character, he shoots a laser beam with his head, I created a script with a raycast for that. My problem is if I use : ( here a Debug.DrawRay)
{
Debug.DrawRay(transform.position, Input.mousePosition, Color.red);
}```
My problem is that my raycast is positioned on my character's collider and not its animation, which creates misalignment.
I thought about animating my raycast, but this solution is long and not clean, if anyone knows cleaner methods, for this kind of effect, I'm interested ^^
The DrawRay function works up from the GameObjects Anchor.
Recheck your GameObject again again 
???
private void Update()
{
Debug.DrawRay(myGameObject.transform.position, Input.mousePosition, Color.red);
}```
```private void Update()
{
Debug.DrawRay(gameObject.transform.position, Input.mousePosition, Color.red);
}```
Adding up the gameObject.transfrom.position have the same effect but thats not checking the GOs anchor as i mentioned.
I don’t understand what you mean by "verify.
My script and attached to the eyeballs of my character, my first shift and due to the axis of my 3d object which is shifted.
The second comes from the collidor.
When my character dies, the dead animation is played, the collider does not follow my character, the laser positions remain on the collider.
So if the collider does not follow your “Player” it means, that your Anchor of your GameObject prob. not as well.
The Animation itself moves your player body.
Thats a different story,
Its like importing an “RUN” Animation and making it move your player without applying any code.
You can disable that anywhere in the animation import settings.
(Im typing on phone so i cant check which setting it is, but its something like: “Make Animation Apply root motion” which needs to get disabled.
ok thank you i will check