the bullet is same size then the player how can i resolve that ?
hello im new to unity and im stack inone place im follow your this video and now im try to make my own game. but when I'm trying to make my player shoot. Every time I do fire, the bullet is same size then the player how can i resolve that ? here is my code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Missile : MonoBehaviour {
//missile speed
public float missileSpeed;
//missile Effect
public GameObject missileEffect;
Rigidbody2D myRB;
// Use this for initialization
void Start () {
myRB = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update () {
myRB.velocity = new Vector2(missileSpeed * transform.localScale.x,0);
}
void OnTriggerEnter2D (Collider2D other){
//missile Effect
Instantiate(missileEffect,transform.position,transform.rotation);
Destroy(gameObject);
}
}
Comment
Your answer
Follow this Question
Related Questions
Trigger is not detecting tag 2 Answers
Constant fire at target 2 Answers
Teleporting To Projectile Location 1 Answer
The shooting mechanics 0 Answers
Bullet collider disabled with player 1 Answer