I tried to assign a script to my object and the error about the compatibility of names ocured. Tried to assign it in another project and dind’t work , even an unmodified script isn’t working. Unity version :Unity 2019.1.8f1 (64-bit). Please Help.,I tried to assign a script to the object , the script name and the name of class is the same but the error ocured anyway. i tried in a new project and it didn’t work , even a unmodified script is not working. Please Help!!
Are you sure there’s no compiler error in general, not just in your script. If there is any compiler error, all your scripts will not be compiled at all. If nothing is compiled you can not attach your script. You did not give the exact error you got, you did not mention if there might be other errors or how your script looks like and how is actually named. Without further information we can only say: Everything is working fine on our side.
ps: You also haven’t mentioned whats your target platform as this can have an influence on how your code is compiled and what things are available. The same is true for the used scripting backend and the .NET version you setup in your playersettings.
@Bunny83 , Visual Studio didn’t show me any errors ,Visual Studio version is that installed by deafult by Unity, the target platform is Android. The script makes the object rotate and float at the same time in menu but even a script that was just created and I didn’t even touched it doesn’t want to attach . Sorry I maybe dont’t understand something , I am a beginner and don’t understand much. Thank you!)))
using UnityEngine;
using System.Collections;
public class CubeFloat: MonoBehaviour
{
public float speed, tilt;
private Vector3 target = new Vector3(0, 1.39f, 0);
void Update()
{
transform.position = Vector3.MoveTowards(transform.position, target, Time.deltaTime * speed);
if (transform.position == target && target.y != 0.1f)
target.y = 0.1f;
else if (transform.position == target && target.y == 0.1f)
target.y = 1.39f;
transform.Rotate(Vector3.up * tilt);
@Bunny83 , @k234234w https://drive.google.com/file/d/1xkvQd9xVIQ9rDGTGCo3QkwKk1A4XxjC_/view?usp=sharing
Here is the screenshot , yes there are errors but there is no message just shows that the errors are.
Thank you)