New answers tagged

1

The nice thing about the Factory pattern is that the base class can be abstract and you can have different derived Factory classes. That means you can have an ExplosionFactory, a BulletFactory, an EnemyFactory and so on, which all inherit from the basic class GameObjectFactory. Any code which is common to all objects would be in the GameObjectFactory while ...


0

You need to rotate the rocket after each "physics" update (I think you are not actually using rigidbodies or physics), like so: You just need the rocket's transform.forward to always point in the same direction as its' velocity, regardless of how you calculate velocity. If "forward" is always pointing in the actual correct direction, you can just push the ...


0

try this: put an empty game object a few units below the rocket, but horizontally in the middle of it. (the more units below the rocket, the slower the rotation will be ). use this code ( just a concept ) //note that this code won't work like this, it's just a guideline public float speed = 0.2f; void Update () { if (outOfFuel) ...


1

Your Question is NOT clear ..but We can do following ways to hide the GAMEOBJECT.. 1.If you use the gameobject -> sprite renderer -> order in layer (set order in layer into 0 or -1) 2.If you use the Canvas Concept Change the gameobject Z position or do game object like, public gameobject hideobj; hideobj.setActive(false); whenever you want that game ...



Top 50 recent answers are included