c # – How do I convert an interface into a MonoBehavior in Unity?

In my iTest.doStuff () method, I try to convert the testInterf _ti interface into a MonoBehavior. This gives me "error CS0246: The namespace type or name could not be found & # 39; MonoBehavior & # 39;", but in the same file, my iTest class has no problem inheriting from MonoBehavior.

//testInterface.cs

using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;

public interface testInterf{//this is my interface
    string Name {get;}
    Sprite mySprite {get;}
    void func();
}

public class testInterfEventArgs : EventArgs {
    public testInterf i;

    public testInterfEventArgs(testInterf _i){
        i=_i;
    }
}

//iTest.cs

using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;

public class iTest : MonoBehaviour{
    public void doStuff(testInterf _ti){//this is the implementation
        Collider collider = (_ti as MonoBehavior).GetComponent();//ERROR
    }
}

Rendering – How to improve Antialiasing in Unity WebGL?

I have a problem with the render in WebGL.

In Unity Editor or Standalone, compilations look perfectly fine, but in WebGl compilations, the image generates these white dots. I have a "Directional Light" and a "Spot Light" on the scene.
The shadow is made by directional light. The spotlight is illuminating the coins.

Image with 1 light bulb

It seems to be a problem with antialiasing. I am using 8x Multisampling and I don't know how to get better results than using 8x Multisampling.

Antialiasing does not work well

Is there another way to improve antialiasing in Unity WebGl?

You need help creating and optimizing a dense forest in Unity with the bird's eye view camera

I am currently developing a real-time strategy game that has a bird view camera that works while I play. One of the central aspects of my game are trees.

So in the previous days I played with trees in Unity.

  • I first played with Unity Tree Creator, but then I realized that it is broken since 2018.3, and the developers said it won't be fixed because it will be a package developed by the community in the future
  • Then I downloaded resources from the store that are said to be highly optimized trees, however, they are mainly for "third-party camera projects", so they have around 7-14k triangles.

After these experiences, I decided to export a prefabricated tree to fbx, then manually decrease the triangle count to around 2.5k in 3ds max, then import it back into Unity. With this technique I was able to produce pretty good results, but I'm still not very satisfied with it.

My camera view and my "dense forest" 180-300fps … and only like 3-4 shadows
enter the description of the image here
For the image above I used a tree with 2 LOD and a billboard (BB).

After playing with this, I realized that I can do better, especially playing with LOD numbers, material optimization and with the default tree trinagle optimization.

However, the problem is that I can't model pines that meet my needs in 3ds max. So I started looking at the SpeedTree documentation, however, it seems a bit too professional for my needs (all tutorials also make trees with 20k poly / tri).

Then regarding this story. I would like to ask the following question + an additional question about LOD:

  • Can you model quality trees with SpeedTree for Unity that have about 1k-2k triangles, or SpeedTree is for high quality / high poly trees, these algorithms will not work with a lower polygon count, etc.? (I heard they have a simplifying modifier, is it good? How to make a triangular tree of 7k and then cut it from 1k-2k)
  • I am thinking of using 4-5 LOD and a BB for a smooth transition. In my image I use 2 LOD and a BB and, sometimes, when I move the camera quickly, the transitions are not as smooth as I want it to be. Therefore, I would like to have more detailed meshes before transitioning to BB. So, is having a 4-5 LOD-s a common practice or a better idea for this?

How to make a tank tracking platform? In unity

How to rig a unit tank track? Do you use animation or use other forms?
Can anyone explain how to do this? Thank you

c # – void Start does not recognize in Visual Studio when creating scripts from Unity

The "empty" start does not turn blue as it should when opening a Unity script. I am new to programming, I have done everything and still nothing.
Can you identify what the problem would be?
The code I show you has not changed at all, it only opened in Visual Studio 2019, which was updated correctly.
Follow the code:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Novoo : MonoBehaviour
{
    // Start is called before the first frame update

    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {

    }
}

How to use 3 cameras simultaneously in Unity

I am working on a project that requires 3 panels, each representing a game object. There will be a search box and when the player enters a string, that keyword will approach the location labeled on each object in the 3 panels. How can I achieve this?

unity – Script component not detected by the Vuforia default traceable event handler script

I have a script component called & # 39; Start & # 39; inside a GameObject called & # 39; StartSpawn & # 39; and I'm trying to execute a function from Start when the destination is found, but Unity / Visual Studio does not detect the startup script component. I even tried to restart Unity and Visual Studio to make the problem worse. When I reopened both programs and inspected the code, the code I added was deleted and the DefaultTrackableEventHandler.cs script returned to its original code. By the way, the function I'm calling instance a prefabricated one.

Here is the code inside DefaultTrackableEventHandler.cs:

protected virtual void OnTrackingFound()
{
    if (mTrackableBehaviour)
    {
        var rendererComponents = mTrackableBehaviour.GetComponentsInChildren(true);
        var colliderComponents = mTrackableBehaviour.GetComponentsInChildren(true);
        var canvasComponents = mTrackableBehaviour.GetComponentsInChildren(true);
        //test
        Start summoner = GetComponentInChildren();

        // Enable rendering:
        foreach (var component in rendererComponents)
            component.enabled = true;

        // Enable colliders:
        foreach (var component in colliderComponents)
            component.enabled = true;

        // Enable canvas':
        foreach (var component in canvasComponents)
            component.enabled = true;

        //test spawn
        summoner.OnAppear();
    }
}

Please provide help as soon as possible, thank you very much.

unity – Prevent Animation Tab From Changes the position of an object

I am quite new to Unity. I am using the latest version. When I try to make an open door animation, it works well with the rotation. But when I add the position property, it takes it to Vector3 – (40,12.5,7.5) – instead of (10,2.5,15) in the first frame. I try to change the value but it reappears after writing. Please help

unity – Software architecture to link several individual projects with a menu / lobby? Please criticize my planned architecture

I am working on a project with a large and extensive team. Think of the project as a way to show the work of different people. Each person is working on an individual experience that must be linked in a menu / lobby system, where the end user can select an experience from a list.

This is how I am thinking of executing the project:
Each experience has little or no overlap in the code, and each one is built in relative isolation by one person. Since this is how the project is executed, as a non-professional Unity developer, it seems that the simplest route would be to make each creator have their own Unity project and simply send an .exe compilation or, hopefully, an exported package of his scene (if that works in this use case, I have only read about it and have not tried it).

We will have a main Unity project for the lobby / menu, which will list the experiences and allow the end user to select one. Once an experience is selected, the compilation for that experience will be launched and the main lobby will be closed.
I will ask each creator to enter a code in their project so that when the user leaves, re-start the lobby before closing.

Now, I see several potential problems with this architecture. I suspect that there would be some Windows security problems in having one .exe start another (assuming that the exported package of the desired scene does not work for some reason). This is a "I know what I don't know" theme. I am sure there is a better way to do this, but I am not sure what it is.

I am very concerned that everyone works in a single project / repository. At least in my experience, it is easy for a person to break things or cause problems that could affect the project as a whole. Not to mention that each creator would need to access and use the entire project and that version of Unity, even if its code and its assets do not overlap with anyone else's.

So, what is the best way to design and design a project like this, where a lobby launches experiences created by independent creators?

Thank you!

Can I use Unity to edit an object created in Blender?

I imported a character from Blender. The character is made of metabolas and, therefore, is not imported correctly. I am trying to edit the character within Unity using the platform of the original Blender object.

The problem I encounter is that I can only access the bones when the object is instantiated. The armor / armor object is not displayed in the project resource folder, and double-clicking on the top-level object only opens in Blender.

Is there a way to make Unity treat the imported Blender object as a native Unity object that can be edited as normal? Any other suggestions welcome.

Screenshots for reference:
enter the description of the image here

enter the description of the image here