If I’m using this code: Physics.Raycast(transform.position, transform.forward, out hit, attackRange, enemyLayer)
How do I make it to where I can adjust my raycast height?
If I’m using this code: Physics.Raycast(transform.position, transform.forward, out hit, attackRange, enemyLayer)
How do I make it to where I can adjust my raycast height?
If you mean “the height from which the ray starts,” just calculate where that is instead of the transform position.
Each of the arguments can be a calculation, not just a value that already exists.
Physics.Raycast(transform.position + 1.6f * transform.up, transform.forward, out hit, attackRange, enemyLayer)
Next time, use these buttons to format your code: ![]()
Oh I see, thank you!