#I want this turret to only shoot at what's in front of it

1 messages · Page 1 of 1 (latest)

abstract stratus
#

I have an idea but I am not sure if it will work

#

So first remove anything that has anything related to seeing or looking

#

Then in the nearest attackable target make must see to true

runic bison
#

so, i change the code but it still shooting behind

#

so this is the code for now, but it does not work

granite notch
#

I believe you need to set the animation to rotate at its target

runic bison
granite notch
smoky apex
#

If you dont want it to rotate at all, i believe you can use minecraft:spawn_entity to shoot the projectile

granite notch
#

Oh yeah, forgot he only wants it to shoot within the turrets pov

cyan heath
#

use script api may be

granite notch
#

No need tbh

dark lodge
#

This would do??

#

ranged_fov: Field of view (in degrees) when using sensing to detect a target for attack.

#

x_max_rotation: Maximum rotation (in degrees), on the X-axis, this entity can rotate while trying to look at the target.

#

Seems if you set these to zero or nearly zero then it might only target and shoot anything in front of it and not rotate?

#

Still have "must see" so you don't target entities behind blocks I guess. But there's no component specifically about looking, I think all entities get a view direction based on their rotation and assumed "head".