

Make sure the parent of AttackLocation is the player.Step into action and battle people from around the globe in an all out shoot out between the red and blue team! Fight for top score in Combat 3! Choose your favorite game mode and engage in a shoot out in dozens of map! Go in a shooting spree against zombies or prevent the opposing team from planting a bomb.Ĭombat 3 is an intense first person shooter game based on the popular Counter Strike. Name the empty game object AttackLocation. So go ahead and select your player game object, right-click, and create an empty game object. Now that we have the enemy, the last thing we need to do is to create a game object for our attack location. Next, select the enemy game object again and this time, change the Layer from Default to Enemy. So once, Layer dropdown is selected, click Add Layer… However, since there’s no Enemy layer yet, we have to create it ourselves.

Then, change the value of Layer from Default to Enemy. Next, select the enemy game objects and add Circle Collider 2D to them. So go ahead to your project window and look for the sprite mole and drag it to your scene. Since we’re working on melee attacks, obviously, we’ll need enemies to test out our attacks. Save all your script and go back to Unity. Rigidbody.MovePosition(rigidbody.position + movement * movementSpeed * Time.fixedDeltaTime) Hf = movement.x > 0.01f ? movement.x : movement.x 0.01f ? movement.y : movement.y < -0.01f ? 1 : 0 Movement.y = Input.GetAxisRaw("Vertical") Movement.x = Input.GetAxisRaw("Horizontal")
Combat 3 unity update#
Start is called before the first frame update Public class PlayerMovement : MonoBehaviour Now that we’re down with Player animation and Animator, let’s proceed to create the script to control our player attacks and its animations.Ĭreate a new C# script and name it PlayerAttack.cs then assign it to your Player game object. Next, we’re going to create transitions from all of our previous animations to our attack animations.įor Any State to Attack Up, set the condition, Vertical greater than 0.1 and Is_attacking to true.įor Attack Up to Idle, set the condition, Vertical less than 0.1 and Is_attacking to false.įor Any State to Attack Down, set the condition, Vertical less than -0.1, Is_attacking to true, and Is_Moving_Side to false.įor Attack Down to Idle, set the condition, Vertical greater than -0.1 and Is_attacking to false.įor Any State to Attack Side, set the condition, Horizontal greater than 0.1, Is_attacking to true, and Is_Moving_Side to true.įor Attack Side to Idle, set the condition, Horizontal less than 0.1 and Is_attacking to false.

Combat 3 unity plus#
Next, select Parameters tab, then click on the plus button and select Bool to create a boolean animator parameter.Ĭlick again the plus button and select Bool and name the parameter Is_Moving_Side. Open your animator window by going to Window Tab > Animation > Animator. Now that we have set up our player attack animations, let’s proceed to our animator and create a new parameter to help our animator change from either idle animation to attack animation or walking to attacking. You should have the following animations.

