I’m trying to access a transform component on a game object but its a property of RectTransform so I need to cast it. When I do an inline cast the compiler throws a fit.
plateBar.(RectTransform)transform.anchorMax = new Vector2(1, 1);
plateBar.(RectTransform)transform.anchorMin = new Vector2(1, 1);
plateBar.(RectTransform)transform.rect = new Rect(50, 50, 300, 100);
Is this correct syntax for casting? I’m hesitant to use GetComponent for performance reasons.