hi foks, i’m trying to add a shot from another tutorial to my “game” unfortunately the command take input from the camera view to detect target of fire, and i need a straigth foward bullet,
i’ve tried everything, vector3 stuff etc… but i’m new to C++ and unity,
any help is welcome,
thanks a lot,
using UnityEngine;
using System.Collections;
public class PlayerShooting : MonoBehaviour
{
public Projectile projectilePrefab;
public LayerMask mask;
I have look on my move routine, and found a couple of data who can help to locate the origin of the fire, and put it to foward, but nothing is displayed
Ray rayToFloor = new Ray(new Vector3(currentPosition.x, currentPosition.y, currentPosition.z), transform.forward);
i dont understood how to code a pure vector of 20 pixel straigth foward from the origin of my plane who is currentposition.x in my tweaked move script.