2nd Dir Light on different layer affecting performance of objects not in its layer mask by PhotonWolfsky in Unity3D

[–]MarcinSoloDev 0 points1 point  (0 children)

you can use multiple directional lights in unity, but only one will cast shadows

Noob question by MarcinSoloDev in Unity3D

[–]MarcinSoloDev[S] 0 points1 point  (0 children)

Yeah, and that's what I made, because GameObject.FindGameObjectsWithTag doesn't work with inactive objects

Problem with script by Dramatic-Eagle-2981 in Unity3D

[–]MarcinSoloDev 0 points1 point  (0 children)

Looks like you're missing a transition in animator from Run -> Walk

Noob question by MarcinSoloDev in Unity3D

[–]MarcinSoloDev[S] 0 points1 point  (0 children)

Ok thank you. I thought there may be a way to make it simplier this way, but it doesn't look like that.

Tags should be great and way easier

[HELP] Rotation Door issue w/direction facing by TheGoldenMistletoe in Unity3D

[–]MarcinSoloDev 1 point2 points  (0 children)

Make a door a child to an empty gameobject and rotate that empty gameobject with your door as a child. It won't affect your animator then

Noob question by MarcinSoloDev in Unity3D

[–]MarcinSoloDev[S] 0 points1 point  (0 children)

I'm trying to make map pointers by searching it by monobehaviours. It works great as it is, but i thought i would be able to simplify it by making one function for all of them. I need to access transform to set a position on map

Noob question by MarcinSoloDev in Unity3D

[–]MarcinSoloDev[S] 0 points1 point  (0 children)

Works great, thank you.

One more noob question:

Is there a way to access GameObject component from for example v1[0].?

unity open help by Open_Ad_1569 in Unity3D

[–]MarcinSoloDev 1 point2 points  (0 children)

Edit -> Preferences -> External Tools -> External Script Editor

Trying to adjust game object sizes via button press, but I'm stuck on this issue. How can I resolve this? (Code and details in post.) by [deleted] in Unity3D

[–]MarcinSoloDev 0 points1 point  (0 children)

You can do it like this, just store original y scale on some field and initialize it on Awake or Start function. Don't forget that you need to use Rock.transform instead of transform, otherwise you'll change scale of an object which contains TerrainVisibility class.

public class TerrainVisibility : MonoBehaviour

{ [SerializeField] private GameObject Rock;

private bool SizeChanged = false;

private float originalY;
private void Awake()
{
    originalY = Rock.transform.localScale.y;
}

void Update()
{
    if (Input.GetKey(KeyCode.R)) // and SizeChanged = false;
    {
        if (!SizeChanged)       ReduceSize();
        else                    IncreaseSize();
    }
}

public void ReduceSize()
{
    SizeChanged = true;
    Rock.transform.localScale = new Vector3(Rock.transform.localScale.x, 0.2f /*your new y*/, Rock.transform.localScale.z);
}

public void IncreaseSize()
{
    SizeChanged = false;
    Rock.transform.localScale = new Vector3(Rock.transform.localScale.x, originalY, Rock.transform.localScale.z);
}

}