Hi all,
could anyone assist please. i am trying to make the gameobject rotate as well as move to the right.
I have tried to make a separate script for the rotation, but does not work,
both scripts are below
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Projectiles : MonoBehaviour
{
[SerializeField]
[Range(0f, 5f)] float projectileSpeed = 2f;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
transform.Translate(Vector2.right * projectileSpeed * Time.deltaTime);
}
}
public class Spinner : MonoBehaviour
{
[SerializeField]
float speedOfSpin = 1f;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
transform.Rotate(0, 0, speedOfSpin * Time.deltaTime);
}
}