We will entertain your mind, enhance your brain, expand your lifestyle.

Beyond the sight

UI for starting the puzzle

In Hepto, each puzzle is an exhibit, and commentary panel objects are placed on each exhibition. Player touch (click) this object to start the puzzle.

In the future, we would like to support game controllers, but in that case, the operation will be to focus the object (object is bordered, object bacames briter, etc.) instead of touching and press the button on the controller to start.

Collider on the camera

To focus an object, there is a method to automatically focus when the target object comes near the center of the screen. As an easy way to implement this, we try about attaching a collider in front of the camera and using it as a trigger.

Unfortunately, this didn’t work. Collider needed a physics component to trigger events, but adding this component made the Cinemachine camera behave strangely. This is the same with use Virtual camera.

Calculate the angle of sight

Next, we examined the logic that the line-of-sight direction (vector in the front direction of the camera) and the vector from the camera to the target object are focused if they are within a certain angle.

However, since there are multiple objects for starting puzzles, it is not possible to calculate all of them at all times, so we narrowed down the processing under the following conditions.

  • Process objects that are in the camera’s field of view (by rendered event)
  • When the distance between the object and the camera is less than or equal to a certain distance
  • Calculate the direction of the object and the angle of the line of sight, and focus if it is below a certain angle.

As a result, it was possible to naturally focus the object to which the line of sight was directed without applying a large processing load.