#How to check if a block is in front/behind/left/right of the player?

1 messages · Page 1 of 1 (latest)

shy bear
#

It doesn’t really

#

But

#

If I had to guess

#

You are referring to something that predicates would solve if you need to check all of those

#

Are the blocks actually “facing” the player

#

Or just next to

autumn shell
#

use local coords?

#

if block ^ ^ ^-1

#

behind

#

if block ^ ^ ^1 infront

#

if block ^1 ^ ^ left I believe

#

and -1 is right

shy bear
#

So the block just has to be next to the player?

#

Then yeah

#

Predicates are easily the best way to go

autumn shell
#

does it have to be right next to the player?

#

or just any block facing the player

#

then you can just use local coords right/

shy bear
#

Don’t use codes based on facing location if it isn’t based on where the player is looking

#

You can end up with some really wacky situations

#

That didn’t make any sense

#

If the feature doesn’t need to be based on where the player is looking, don’t use local cordinates

#

Just use ~

#

Yeah

#

Alternate just basically is an or statement for the terms in it

#

So

#

This or this or this or this

#

¯_(ツ)_/¯

#

Yep