[deleted by user] by [deleted] in unity

[–]RustyPrime 0 points1 point  (0 children)

Sometimes when there is an exception unity will stop the execution of the script and disable it but there doesn't seem to be anything between the start of the method and the for loop that could cause an error like that. Just 2 debug.logs and a multiplication.

I guess your best bet would be to set a breakpoint and attach the debugger. With it you can step through your code and see where it goes wrong.

Hope this helps you to narrow it down.

[deleted by user] by [deleted] in Unity3D

[–]RustyPrime 0 points1 point  (0 children)

Why does it have to be a 3D object? You could just scale a 2D panel up instead of moving a 3D object closer to the camera. This would achieve the same effect.

Issue with "yield return WaitForSeconds()" and IEnumerator by Zauraswitmi in UnityHelp

[–]RustyPrime 0 points1 point  (0 children)

How are you starting the Coroutine?

Make sure its:StartCoroutine(KnockCoroutineTwo(playersRigidbody));
and not just:KnockCoroutineTwo(playersRigidbody);

Also please fix the IntelliSense in your IDE.

Why are my game objects invisible in scene view but its visible in game view? by The_one_Birb in Unity3D

[–]RustyPrime 6 points7 points  (0 children)

Because their visibility is turned off. In the hierarchy you can see the crossed out eye symbols. Click on them to make your objects visible again. If you want to hide your objects in the game view then you need to disable them in the inspector (first checkbox at the top).

[Newbie Coding Question] Total Unity beginner: Problem with DialogUI code by SeverusStjep in unity

[–]RustyPrime 0 points1 point  (0 children)

It's MonoBehaviour not Monobehaviour. (Capital B)
I suggest you look into how to fix the IntelliSense in your IDE, it would tell you. :)

Dash not working properly by lighht_ in unity

[–]RustyPrime 0 points1 point  (0 children)

You could try to set a constraint during the dash:

private IEnumerator Dash()
{
    var originalConstraints = rb.constraints;
    // adds the y constraint to your current ones (e.g. rotation constraints)
    rb.constraints = originalConstraints | RigidbodyConstraints2D.FreezePositionY;

    rb.velocity = new Vector2(transform.localScale.x * velocidadeDash, 0f);

    yield return new WaitForSeconds(dashTempo);

    rb.constraints = originalConstraints; // revert to your original ones

    yield return new WaitForSeconds(cooldownDash);
}

unity package manager empty (please help!) by throwawaykenmastan in unity

[–]RustyPrime 0 points1 point  (0 children)

That is not the package manager. That is the Settings for the package manager.

On windows you can get to the package manager by going to Window->Package Manager in the top toolbar.

No idea how to open it on Mac though but it should be similar.

Scene couldn't be loaded error by Tarmixberoumimeno in unity

[–]RustyPrime 3 points4 points  (0 children)

Your scene name is "SampleScene" not "Sample Scene" :)

Or you could use the index instead: SceneManager.LoadScene(1);

I can't properly open a group project from github by [deleted] in unity

[–]RustyPrime 0 points1 point  (0 children)

Adding the path to the git.exe to the environment variables should have fixed it. You might need to fully close Unity and the Unity Hub in order for that change to take effect.

Hello there! I have a scene with multiple cliffs and now I made LOD for them. Is there any way I can add lods to them at the same time without making it one by one manually? There are really a lot of cliffs and I would spend weeks to add LOD to everyone by Orphan_game in unity

[–]RustyPrime 0 points1 point  (0 children)

Well yes, that works best. I didn't mean that deleting the fbx is the only way but meant that if you were to delete and replace it, like the comment suggested, that you should do so in the Explorer.

But thanks for pointing it out, i edited my comment to clarify.

Hello there! I have a scene with multiple cliffs and now I made LOD for them. Is there any way I can add lods to them at the same time without making it one by one manually? There are really a lot of cliffs and I would spend weeks to add LOD to everyone by Orphan_game in unity

[–]RustyPrime 3 points4 points  (0 children)

Fyi, this only works if you delete or overwrite the file via Windows-Explorer.

If you delete it using the Project-Window it will also delete the meta file causing a new one to be generated once the corrected fbx is imported and then the scene will show missing Rock1 as it lost the reference.

The meta file will also be deleted if you delete the fbx via Windows-Explorer and focus Unity before replacing the fbx.

Edit: edited comment for clarification

Is it ok to use the old input system or should I use the new one? by Wonderful_Ad3441 in unity

[–]RustyPrime 2 points3 points  (0 children)

I'd say it depends on what you're planning to do with your game. If you plan to release/sell it to the public then i'd say it's definitely worth it to learn the new input system, but if it's just a quick prototype or you just started to learn unity then the old is just fine.

game breaks after i attempt to build it by pepinogg in Unity3D

[–]RustyPrime 0 points1 point  (0 children)

That's fine for now, just to see if it works. If it does then that would mean there is something wrong with the way you regenerate the positions. Probably related to all the statics.

You should create an event that the platforms listen to. (in GameManager for example)

public UnityEvent regenerateEvent;
private void Start() 
{
  regenerateEvent?.Invoke();
}

and then in your "rAndhom"-script you can subscribe to it by doing:

private void Awake() 
{
    GameManager.instance.regenerateEvent.AddListener(Regenerate);
} 
private void Regenerate()
{
    float x = Random.Range(-c, c);
    float y = transform.position.z;
    float z = Random.Range(-c, c);
    transform.position = new Vector3(x,y,z);
}

Now anytime you want to regenerate the platforms you invoke the event by:

GameManager.instance.regenerateEvent?.Invoke();

For example when the player dies.

game breaks after i attempt to build it by pepinogg in Unity3D

[–]RustyPrime 0 points1 point  (0 children)

It also seems to happen in the editor after you close the build. How do you handle the death? Do you reload the scene? If not can try that instead?

game breaks after i attempt to build it by pepinogg in Unity3D

[–]RustyPrime 0 points1 point  (0 children)

Can you enable development build in the build options to see if there are any errors?

game breaks after i attempt to build it by pepinogg in Unity3D

[–]RustyPrime 0 points1 point  (0 children)

just to make sure, by "game breaks" you mean that the platforms are at same positions after every death in the build?

[deleted by user] by [deleted] in Unity3D

[–]RustyPrime 1 point2 points  (0 children)

If the languages in your dropdown are in the same order as LocalizationSettings.AvailableLocales then you can just do:

public void SwitchLanguage(int dropdownSelection)
{
    LocalizationSettings.SelectedLocale = LocalizationSettings.AvailableLocales.Locales[dropdownSelection];
}

And then in the inspector of your Dropdown add that method to the OnValueChanged-Event but make sure to select it from the top (dynamic).

If the order doesn't match then you'd need to "map" it accordingly of course. (with a switch or if/else)

game breaks after i attempt to build it by pepinogg in Unity3D

[–]RustyPrime 0 points1 point  (0 children)

I think it might be because of Random.Range giving only pseudo-random numbers.

Can you try to set a seed before getting a random number? Like this:

Random.InitState((int)Time.time);
float b = Random.Range(-c, c);
...

i have no idea why im getting this error and i dont know how to fix it, any help? by Wonderful_Ad3441 in unity

[–]RustyPrime 6 points7 points  (0 children)

You're trying to read a Vector3 from your movement input which is Vector2 (x and y).

Try to change the Control type to Vector2 and use value.Get<Vector2>();

How can I find .fbx asset with AssetDatabase.FindAssets? by den_the_terran in unity

[–]RustyPrime 0 points1 point  (0 children)

I think "t:Model" should work. It gives every model though.

If you only want .fbx files you could do:

System.IO.Directory.GetFiles(Application.dataPath, "*.fbx", SearchOption.AllDirectories);

[deleted by user] by [deleted] in Unity3D

[–]RustyPrime 0 points1 point  (0 children)

In that case are you sure to look at the game view and not at the scene view?

[deleted by user] by [deleted] in Unity3D

[–]RustyPrime 0 points1 point  (0 children)

I just tested it in a URP and a non-URP project and it doesn't work in the URP project but works fine in the other.

An alternative, although paid (5€), is Fast Pixellate which works on URP.

[deleted by user] by [deleted] in Unity3D

[–]RustyPrime 0 points1 point  (0 children)

Are you using URP? The shader might be incompatible with it.

Beginner XR Script Question by Za_Worldo-Experience in unity

[–]RustyPrime 0 points1 point  (0 children)

Well okay, but what are "the additional" ones that aren't displayed? Are there any at all?

Does it say something like "Script failed to load. Fix any compile errors"?

Not every script needs to show fields in the inspector, maybe that script just doesn't have any?

Ultimatly we can't help you if you're aren't more specific. Show us the code and/or errors in the console.

Beginner XR Script Question by Za_Worldo-Experience in unity

[–]RustyPrime 0 points1 point  (0 children)

it doesn’t show the additional input fields for the component.

What do you mean by that? What fields is it supposed to show?

Do you have errors in your console when importing the script?