Y
Y
Yuriy_Code2021-10-09 16:04:23
Unity
Yuriy_Code, 2021-10-09 16:04:23

How to track the side of pressing an object?

How to track the side of pressing the cube, for example? Like in Minecraft. It is to track that it is not just a click, but on which side of the cube it is.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2021-10-09
@GavriKos

On stupid - put on a collider on each side of the cube.
According to smart - geometrically - there is a point where the "pressing" comes from - the player\hand. There is a center of the cube. Find the intersection point of this line with the face of the cube.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question