Hello. I am having this problem when the avatar picks up a throwable object, all objects throw instead of the one that was picked up. Can someone help me solve this problem?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Projectile : MonoBehaviour
{
public Throwable direction;
public float speed;
void Start()
{
direction = GameObject.FindGameObjectWithTag("Player").GetComponent<Throwable>();
}
void Update()
{
transform.position += direction.offset * Time.deltaTime * speed;
}
}