Relative Content

Tag Archive for c#unity-game-engineuser-interface

Why doesn’t the first instantiated object follow directions?

I’m building a fitness tracking app. The idea behind this specific part of the UI is that the user can add sets to the drills they are doing by pressing the “+Set” button. It instantiates a new prefab in a scrollview. When instantiated, the label should update with a set number (“Set 1,” “Set 2”, etc.).

How to detect the proper World space UI element’s position using GraphicRayCaster?

Good afternoon. I am trying to interact with UI elements within a worldspace canvas due to Unity 2022 LTS not supporting interaction via the New Input System when using a locked cursor. The issue I am having is that I am able to detect the UI elements but it seems like it is detected UI locations are not at the correct location. It seems like it is scaled down from the X axis or something. There is no detection issues on the Y axis. It only seems like the x positions are scaled down or offset.

In Unity, calculating a UI document’s Visual Element’s world space

I am using the new UI system (that is a UI Document) in which I have a four visual elements nested in each other.
The first three are in position Relative and the fourth one is position Absolute and is referenced using _goalBoxes[goalId].
I want to set the position of a GameObject with a particle system to play the particles where the fourth visual element appears on the screen.