C
C
coderDimka2019-04-06 14:32:38
C++ / C#
coderDimka, 2019-04-06 14:32:38

How in unity3d in a script to check whether a game object is currently displayed or not?

I'm learning how to create a 2D game on this websketches.ru/blog/2d-igra-na-unity-podrobnoye-ru... resource
In the scrolling script there is such a moment:
// add only visible children
if(child.renderer!=null)
{
backgroundPart.Add(child);
}
Here child is of type Transform and it does not have a property (field) renderer, that is, it seems to be a deprecated property and it is not in the new version of Unity3d. I can’t find where this field has migrated to, or maybe it was renamed?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GavriKos, 2019-04-06
@coderDimka

Removed:
https://docs.unity3d.com/ScriptReference/Component...
About "visible" some kind of nonsense - renderer is just an alias to the Renderer component, i.e. it is possible to replace through GetComponent, for example. But this will not mean that this object is visible to the camera.

F
freeExec, 2019-04-06
@freeExec

GeometryUtility.TestPlanesAABB

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question