Tag Info

New answers tagged

1

GameObjects are very closely linked to Transforms. The GameObject could be thought of as a container to hold a set of Components e.g. scripts, colliders etc. Meanwhile the Transform holds properties than connect the GameObject to the the world e.g. position/scale/rotation and any parent/child relationships. Parent: When scripting you can access the ...


1

I assume you've left out some code? Like that CMyMainScript and CMyGeneric extends MonoBehaviour? Are you expecting to be able to access gameObject inside your CMyGeneric class because you'd instantiated it inside another class? If you want to access gameObject you need to attach that script to a game object by using ...


0

In our engine, the component class only manages the scene graph, dirty state management and notifying the root scene that the scene graph has changed.. components may implement IUpdatable and IRenderable as needed, and the root scene tracks any graph changes and maintains lists of updatable and renderable components to process during a frame update. This ...


0

The answer was here: http://answers.unity3d.com/questions/194798/scripting-animated-variables.html Animations always "take over" the control of the animated value (position / rotation / or a script value) because it always sets the value to an absolute value. However you still can affect the value but you have to decide what's the better solution ...


0

Normally different sub-engines take care of ticking their associated components in game objects. For example your rendering engine ticks only the rendering components of game objects that are visible on the screen, while your AI/physics engine could tick what's on the screen + outside with some decreasing frequency based on the distance. You don't tick all ...


1

Your idea is correct, only render and update entities near the player for better performance. To do this in a efficient manner, you will need some sort of spatial partition to know what is near the camera. You definitely don't want to loop through all the entities on your map. One of the most efficient ways to use is a hash table, also known as a grid. But ...


0

If I understood the problem correctly it's not that hard to solve. You track the position of every entities and update/render them only if they are inside or near the view field. The other way round you can of course destroy them if they are outside the view frustum (if you want that). Just loop through the container and check x and y coordinates and ...



Top 50 recent answers are included