Answer the question
In order to leave comments, you need to log in
Error Unity.2019.2.13f1?
Goal: we need the sword to rotate in z by 47, and after 0.3 seconds, return to its initial position.
unity errors
1 error
Non-invocable member 'Transform.rotation' cannot be used like a method.
2 error
Assets\Scripts\Game.cs(30,15): error CS1061: 'GameObject' does not contain a definition for 'trasnform' and no accessible extension method 'trasnform' accepting a first argument of type 'GameObject' could be found (are you missing a using directive or an assembly reference?)
Code
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine;
public class Game : MonoBehavior
{
public GameObject sword;
public GameObject shield;
public static int money;
public static int gems;
public static int life;
void Start()
{
print("Game Started - by Illia");
life=100;
}
public void atack0()
{
StartCoroutine(atack0());
}
IEnumerator atack0()
{
sword.transform.rotation(0f, 0f, 47f);
yield return new WaitForSeconds(0.3f);
sword.transform.rotation(0f, 0f, 1f);
}
}
Well, or here's a screenshot of the
PS script, if you know, just write the line that you need to change, and change it
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question