So, i was working with some prefabs and got curious about something.
Is it possible to move a instantiated prefab (using transform.Translate for example) directly in the script it is instantiated?
Or do i really need a script just for it?
Just to give some context i instantiate a “laser” from the player script:
if (Input.GetKeyDown(KeyCode.Space))
{
Instantiate(_laserPrefab, transform.position + new Vector3(0, 1, 0), Quaternion.identity);
}
but i need to make a separated script to create it’s behavior, i was trying to do it directly in the player script but couldn’t do it