This shows you the differences between two versions of the page.
pjv:laboratoare:en:03 [2019/10/23 15:19] alexandru.gradinaru |
pjv:laboratoare:en:03 [2019/10/23 15:19] (current) alexandru.gradinaru [2D animations in Unity] |
||
---|---|---|---|
Line 113: | Line 113: | ||
For shooting animation, a status is generally used to update the player's animation, and the projectile is generated as follows (recommended): | For shooting animation, a status is generally used to update the player's animation, and the projectile is generated as follows (recommended): | ||
- | * Unordered List ItemA script is added to the weapon (which is on the scene) that manages the projectile generation and direction | + | * A script is added to the weapon (which is on the scene) that manages the projectile generation and direction |
- | * Starting from the location of the weapon, a projectile (using the Instantiate function, already studied) is instantiated (prefab as a rule, it must not already exist on the scene, using the position of the weapon). The projectile has attached a script containing details of speed, damage, etc. | + | * Starting from the location of the weapon, a projectile (using the Instantiate function, already studied) is instantiated (prefab as a rule, it must not already exist on the scene, using the position of the weapon). The projectile has attached a script containing details of speed, damage, etc. |
- | * The projectile has a continuous translational motion in one direction, until it reaches a limit or collider when it triggers | + | * The projectile has a continuous translational motion in one direction, until it reaches a limit or collider when it triggers |
=== Animations and scene instancing ==== | === Animations and scene instancing ==== |