This post has been wikified, any user with enough reputation can edit it.
How to shoot to a vector2 of a gameObject's Position??
using UnityEngine; using System.Collections;
public class BulletForward : MonoBehaviour {
public float penetrate = 20.0f;
public float BulletSpeed = 1.0f;
public int penetrateSpace;
void Update () {
transform.position = Vector2.Lerp (transform.position,Vector2.up, BulletSpeed * Time.deltaTime);
}
}
when this code is written the bullet goes to the center of the World and not and not To the GameObject's position .
Comment