#πŸ’»β”ƒcode-beginner

1 messages Β· Page 75 of 1

summer stump
#

A classic example of an interface are the buttons on a vcr/dvr/etc.
Play, Stop, Rewind, etc all cause something similar.
But on a VCR rewind means physically spinning a motor backwards. On a DVR it means moving a laser towards the center..

You don't need to know how it works, just what it does.
Then, as technology advances, you can always still call play, and you just swap in a different implementation, and all other code remains the same

cosmic dagger
#

funny enough i'm fixing . . . err . . extending my Stat class now to use a max value for resources, just like Health, Mana, etc . . .

copper perch
#

I have a unity starter assets fps controller.
I have a floating joystick separately added to it, as a child of the UI_CANVAS_STARTERASSETSINPUTS_JOYSTICKS.
I created a new Floating Joystick script with Chat GPT to make the look pad turn left and right slower, and when I hold the screen left or right for the look pad not to turn the camera around left and right in circles, around and around.
I did not even add the new script to the Floating Joystick because it had red underline, but I saved it, then I deleted the script because I could not get rid of the red underline.
When I went back I could not enter Play Mode, and in the Joysticks script which is part of the Unity Starter Assets FPS Controller scripts something in that script had red underline, and had changed.
The Joysticks script is part of the Joysticks pack, and the Joysticks script is not on the Unity Starter Assets FPS Controller.
Somehow the new joysticks script I made, saved, and did not add to any gameobject, then deleted is effecting the joystick script that is not on any gameobject, or on the Unity Starter Assets FPS Controller.
How to fix this?
I am thinking of deleting the Unity Starter Assets FPS Controller, and the Floating Joysticks and maybe it will fix this but, is there something I can swrite in C# in the joysticks script to fix this?

modest barn
#

Whenever I try to use gameObject.AddComponent() instead of new() my app just crashes. I have reached the conclusion that the compiler stack is overflowing which means something recursive is going on that shouldn't be. Can someone help me out? This is my code:

using System;
using TMPro;
using UnityEngine;

public class DecodeButton : MonoBehaviour
{
    [SerializeField] TMP_InputField plaintextInputField;
    [SerializeField] TMP_InputField shuffletextInputField;
    [SerializeField] TMP_Text outputTextBox;

    Encoders encoderScript;

    void Start()
    {
        encoderScript = gameObject.AddComponent<Encoders>();
    }

    public void OnClick()
    {
        int shuffle;
        Int32.TryParse(shuffletextInputField.text, out shuffle);
        string output = encoderScript.ShiftCaesarCipher(plaintextInputField.text, shuffle);

        outputTextBox.text = output;
    }
}
#

Changing

encoderScript = gameObject.AddComponent<Encoders>();

to

encoderScript = new Encoders();

made the program run properly, but of course I got the error about using new().

keen dew
#

Show the Encoders class

modest barn
# keen dew Show the Encoders class
using System;
using UnityEngine;


public class Encoders : MonoBehaviour
{
    // Pre-defining the ordered alphabets and integers for ease of access in all functions that need it
    char[] upperAlphabet;
    char[] lowerAlphabet;
    int[] integers;

    // Start is called before the first frame update
    void Start()
    {
        // Fetch lists from ListConstants.cs to ensure that it is fully updated.
        upperAlphabet = ListConstants.upperAlphabet;
        lowerAlphabet = ListConstants.lowerAlphabet;
        integers = ListConstants.integers;
    }   

    public string ShiftCaesarCipher(string plaintext, int shuffle)
    {
        if (string.IsNullOrEmpty(plaintext))
        {
            return "";
        }

        string encodedStr = "";
        foreach(char ch in plaintext)
        {
            // Digits remain unchanged
            if(Char.IsDigit(ch))
            {
                encodedStr += ch;
                continue;
            }
            
            if(Char.IsUpper(ch))
            {
                // Takes the index of the char in the ENCODED string, adds that (also works with negative numbers) to the index, and adds the new char in the array to 'decodedStr'
                char newCh = upperAlphabet[(Array.IndexOf(upperAlphabet, ch) + shuffle)];
                encodedStr += newCh;
                continue;
            }
            
            if(Char.IsLower(ch))
            {
                char newCh = lowerAlphabet[(Array.IndexOf(lowerAlphabet, ch) + shuffle)];
                encodedStr += newCh;
                continue;
            }
            
            // If the character is not a digit or alphabetical character, add it without shuffling it.
            encodedStr += ch;
        }

        return encodedStr;
    }
}
keen dew
#

Does that need to derive from MonoBehaviour?

modest barn
#

I don't really know if it does, I'm new to Unity. All I know is that it either has to derive from MonoBehaviour or ScriptableObject, right?

keen dew
#

No, it can be just a plain C# class

modest barn
#

In what cases does a script have to derive from MonoBehaviour? If I know that I can tell you if it needs to derive

modest barn
#

I don't claim to know why though πŸ˜…

keen dew
#

Whenever it needs to use the methods and properties in the MonoBehaviour class

modest barn
keen dew
#

Yes, but you don't need to use it

#

make a normal constructor

modest barn
keen dew
#

Awake is also a MonoBehaviour method

modest barn
#

Oh yeah i read the shortened list my bad

modest barn
keen dew
#

it has nothing to do with SOs though

modest barn
#

I didn't really look into it and I'd never heard of them before πŸ™‚

fierce shuttle
#

MonoBehaviour allows you to have a script that can be attached to a GameObject in the scene, ScriptableeObject lets you create an asset of a script (often used as data), if your script can do its logic without needing things like Start, Awake, OnEnable, OnCollisionEnter, etc, then you likely dont need it to be a MonoBehaviour, however a MonoBehaviour can also hold references to scripts that are not a MonoBehaviour or derive from anything, you can even serialize non-mono classes in most cases

modest barn
#

Ahh that's very insightful

#

Thank you @fierce shuttle!

modest barn
#

Now that I'm using constructors, I'm having an issue with a StackOverflow error.

#
StackOverflowException: The requested operation caused a stack overflow.
DecodeButton.Start () (at Assets/Scripts/DecodeButton.cs:16)
#

DecodeButton.cs:

using System;
using TMPro;
using UnityEngine;

public class DecodeButton : MonoBehaviour
{
    [SerializeField] TMP_InputField plaintextInputField;
    [SerializeField] TMP_InputField shuffletextInputField;
    [SerializeField] TMP_Text outputTextBox;

    Encoders encoderScript;

    void Start()
    {
        // encoderScript = gameObject.AddComponent<Encoders>();
        encoderScript = new Encoders();
    }

    public void OnClick()
    {
        int shuffle;
        Int32.TryParse(shuffletextInputField.text, out shuffle);
        string output = encoderScript.ShiftCaesarCipher(plaintextInputField.text, shuffle);

        outputTextBox.text = output;
    }
}
#

Encoders.cs:

using System;
using UnityEngine;

public class Encoders
{
    // Pre-defining the ordered alphabets and integers for ease of access in all functions that need it
    char[] upperAlphabet;
    char[] lowerAlphabet;
    int[] integers;

    public Encoders()
    {
        // Fetch lists from ListConstants.cs to ensure that it is fully updated.
        upperAlphabet = ListConstants.upperAlphabet;
        lowerAlphabet = ListConstants.lowerAlphabet;
        integers = ListConstants.integers;
    }
    
    public string ShiftCaesarCipher(string plaintext, int shuffle)
    {
        if (string.IsNullOrEmpty(plaintext))
        {
            return "";
        }

        string encodedStr = "";
        foreach(char ch in plaintext)
        {
            // Digits remain unchanged
            if(Char.IsDigit(ch))
            {
                encodedStr += ch;
                continue;
            }
            
            if(Char.IsUpper(ch))
            {
                // Takes the index of the char in the ENCODED string, adds that (also works with negative numbers) to the index, and adds the new char in the array to 'decodedStr'
                char newCh = upperAlphabet[(Array.IndexOf(upperAlphabet, ch) + shuffle)];
                encodedStr += newCh;
                continue;
            }
            
            if(Char.IsLower(ch))
            {
                char newCh = lowerAlphabet[(Array.IndexOf(lowerAlphabet, ch) + shuffle)];
                encodedStr += newCh;
                continue;
            }
            
            // If the character is not a digit or alphabetical character, add it without shuffling it.
            encodedStr += ch;
        }

        return encodedStr;
    }
}
#

The error is throwing in DecodeButton.cs at the line encoderScript = new Encoder();.

eternal needle
modest barn
#

Yeah sorry will do

eternal needle
#

since this only seems to go to Encoders ctor and ListConstants, i assume ListConstants has the issue

modest barn
eternal needle
#

just a note as well aside from your issue, caesar cipher is absolutely useless at real security. There are built in libraries which u can use to implement anything u want like AES, DES, RSA

modest barn
#

In ListConstants.cs I have shorted commonWordsLIST so that the paste doesn't look insane, but it has 10,000 words in it.

modest barn
#

What do you think the issue is? I just don't get where the recursive behaviour is coming from

eternal needle
#

i dont entirely see where it could be from. Did you save your scripts? maybe you had some recursive behaviour before but didnt save this latest version

modest barn
#

No it's all saved as of now.

#

There was a long discussion between me and @feral flax in this thread but we never got to the bottom of it, just found a way around using it.

eternal needle
#

ill paste those scripts into my project and see more, gimme a min

modest barn
eternal needle
#

what u sent is fine assuming its updated

modest barn
#

Yeah it is

eternal needle
#

i assume the error isnt from here tbh but ill try

modest barn
#

"From here"?

eternal needle
#

i think it might be caused by another reason but im just checking if i get the same error first. which would mean i missed something when reading the code

eternal needle
# modest barn "From here"?

Yea no stackoverflow from me, i put decode button on a gameobject and ran the game. Start mustve run, so line 16 ran and no issue

modest barn
#

I haven't got the script in a gameobject

#

Because I'm not actually running the script yet

#

It just fails to compile at build

#

I think

eternal needle
#

can u show a screenshot of your console in unity with the errors

modest barn
#

Oh wait

#

That's my bad I do

#

It's in the button 🀦

eternal needle
#

Ok this might be an extreme long shot, but maybe that long list (you said 10k words) is causing issues since this is mobile

modest barn
#

Ok I'll shorten it down

eternal needle
#

oh wait but i realize u arent referencing it from Encoders

modest barn
#

Oh

#

It worked

#

It was the long list

#

I guess your long shot was genius

#

It did it

eternal needle
#

Honestly thought of it before i copied the scripts incase u were on mobile but thought it was too dumb lol

modest barn
#

There's no way it was just failing to compile a list

eternal needle
#

that really is a lot of memory

modest barn
#

We can't be talking more than a megabyte or something

#

But I definitely do not understand memory

#

So we probably are talking about more than a megabyte

modest barn
#

Which is actually quite a nice feature

eternal needle
#

the simulator is probably way weaker

#

not entirely sure, i havent done mobile dev in a long time

modest barn
#

Yeah

#

How much memory do you think that list is actually using?

eternal needle
#

are u absolutely sure u had the scripts compiled? This is still odd to me

modest barn
#

Or was*, I guess

modest barn
eternal needle
modest barn
#

Yep it did

modest barn
iron veldt
#

Hey guys so I'm trying to get my ball to move when I click somewhere on the map using my mouse, but when I left click somewhere my ball moves like an inch in some weird direction and then you need to click like 20 times to barely see any movement. Here is what I have and I'll see if I can send a video later on what is happening if any of you can help...please....Here is what I've got.

eternal needle
# modest barn How much memory do you think that list is actually using?

honestly i have no clue, you would have to loop through the list and add it up with some method to check the number of bytes. also depends if we are talking bits or bytes, probably bytes since minimum u could use is 1 byte.
Strings do take up a decent amount, if some of those strings were long it'd probably be an entire MB

pale hazel
#

i'm very beginner into coding and i wanna think of a way to make python able to generate infinite variables for me, like for example the abbility to put more than 2 calculations and numbers in a calculator like an actual calculator

#

idk how to explain this better tbh

modest barn
#

Am I confusing terms? That iPhone has 6GB of RAM. How on earth does 1 MB do anything?

#

Or is this cache we're talking about

eternal needle
iron veldt
eternal needle
eternal needle
eternal needle
modest barn
#

Yeah. I seriously appreciate it though, I would never have thought of that and I doubt many other would've either. Probably would've had to give up due to never figuring it out! Absolutely brilliant. Now, what would you suggest I use to store those words?

pale hazel
eternal needle
pale hazel
#

so anyway bye

modest barn
#

All I'm doing is looping over it

eternal needle
#

it would be slower so if its very often itll be noticeable, which is why i ask the use case

#

file stuff is never quick in relative to having it in memory already

modest barn
#

Well I'm only using it for the bruteforce, so it won't be that often

#

It's not a big issue

#

And I'm going to look into implementing a trie to make it faster anyway.

#

How do I work with files in Unity? Never done that before. Is there a guide out there somewhere?

eternal needle
#

i havent used unity mobile simulators, maybe theres a way u can play with the settings to give it more power. I still am unsure that a phone would have an issue with this

burnt vapor
eternal falconBOT
eternal needle
modest barn
#

Focusing on android right now

eternal needle
# modest barn Focusing on android right now

I vaguely remember seeing something about having to use unitywebrequest or some other way to read files instead of the standard c# StreamReader.. but yea google will probably help u more than me here

modest barn
#

I'll check it out, I expect it'll be reasonably well-documented

#

But now my Debug.Log() isn't doing anything

#

DecodeButton.Start:

void Start()
{
    Debug.Log("hi");
    // encoderScript = gameObject.AddComponent<Encoders>();
    encoderScript = new Encoders();
}
#

And the Console prints nothing when I run the app

#

Why?

burnt vapor
#

Then it does not run

eternal needle
#

hm we can probably bring this to a thread then since its been a long talk πŸ˜…

modest barn
#

A long talk indeed 😁

#

Debug.Log not Working

fossil drum
#

As long as it doesn't interfere with other questions its fine I guess?

modest barn
fleet patio
#

Where I can rebuild project files in Unity 2023?

#

Ok I didn't had Visual Studio in package manager installed after yesterday accident with shift-deleted "packages" folder gx_pepeclown

somber wren
#

Hello guys, i've this little piece of code :

 float distToG = GetDistanceToGround();
   if (distToG < heightFromGround || distToG > heightFromGround)
       transform.position += transform.up * (heightFromGround - dist);
}


public float GetDistanceToGround()
{
   RaycastHit hit;
   float distanceToGround = 0f;

   Debug.DrawRay(raycaster.position, -transform.up);
   if (Physics.Raycast(raycaster.position, -transform.up, out hit))
   {
       distanceToGround = hit.distance;
   }

   return distanceToGround;
}```

This code makes the object assigned to always at the same distance from the ground and its working just fine on my test scene
#

but in my world, its going through the ground and i dont know why (the little white line in the middle is the DrawRay of the raycast)

Everything has a mesh collider

solemn fractal
#

!code

eternal falconBOT
somber wren
#

?? i did it

solemn fractal
#

Good morning guys. Any good soul can help me out here? tried yesterday a lot of stuff and still cant understand why I am not being able to get my cs _finalBossOne._finalBOCurrentHealth I always get its default value.. I have a method called CoroutinesController() where I summond the boss and do some checks. I set him to summon at level 1 just to do tests. But it seems I cant get his hp, I have this cs [SerializeField] private FinalBossOne _finalBossOne; and his prefab assigned in the inspector. Always done like that with other bosses enemies never had a prob. here is the full code. Thank you in advance. https://paste.ofcode.org/itQmdqS9peDtDKJw3x7ZQL

keen dew
#

his prefab assigned in the inspector

#

again, if the reference is to a prefab then you're reading the prefab's values, not the instantiated object's

somber wren
#
  • you're trying to get a private field in another script
keen dew
#

I assume this is all in the same script

solemn fractal
keen dew
#

No of course not because you assign it to a local variable

burnt vapor
#

Welcome to scopes

keen dew
#

make a field and assign it there

somber wren
solemn fractal
#

I can access it but the value still doesnt come

keen dew
#

doubt

burnt vapor
#

Or define the variable outside the if-statement, and assign it inside the if-statement

solemn fractal
somber wren
#

why dont you just put a boss already in your scene with everything set but you disable it, and when it comes to spawning it you just enable it ?

solemn fractal
#

that is the wierd thing

keen dew
#

Ok do it correctly, try it, and show the code if it doesn't work

solemn fractal
somber wren
somber wren
solemn fractal
#

defined variable outside cs private FinalBossOne _finalBossO; now I am creating the boss like that cs _finalBossO = Instantiate(_finalBossOne, new Vector3(_player.transform.position.x + 5, _player.transform.position.y + 20.5f, 0), Quaternion.identity); and trying to get it here cs if (_finalBossO._finalBOCurrentHealth <= 0 && _canSpawnSlime){ Debug.Log("I AM IN !!!"); _coroutineSlime = StartCoroutine(SpawnSlimes(0.5f)); _canSpawnSlime = false; } and get object reference not set to an instance .. full code https://paste.ofcode.org/NmNYGRARVBcy4f8huS5PUY

somber wren
#

yes

#

what is "_finalBossOne"

keen dew
#

That code runs even when the boss hasn't spawned

#

You have to check that it's not null in that specific check

somber wren
#

_finalBossOne doesnt exist here

solemn fractal
#

so i can summon it using the instantiate

#

oh why not? how to fix tho? please save me that is driving me crazy

#

hahahaha

keen dew
#

Of course it exists

somber wren
#

you're getting the error in the if ?

solemn fractal
#

yes here cs if (_finalBossO._finalBOCurrentHealth <= 0 && _canSpawnSlime){ Debug.Log("I AM IN !!!"); _coroutineSlime = StartCoroutine(SpawnSlimes(0.5f)); _canSpawnSlime = false; }

somber wren
#

then i think its never instantiating it

keen dew
#

Yes it is, but the if statement is checked before that happens

somber wren
#

oooh yeah maybe too

#

problem solved

#

it is but too late xDD

solemn fractal
#

hmmm.. let me check that.

#

ok done like that cs if (_finalBossO != null){ if (_finalBossO._finalBOCurrentHealth <= 0 && _canSpawnSlime){ Debug.Log("ENTREI !!!"); _coroutineSlime = StartCoroutine(SpawnSlimes(0.5f)); _canSpawnSlime = false; }

#

but still cant get the valiue of _finalBossO._finalBOCurrentHealth

somber wren
#

you can set a bool "isSpawned" too but yeah

solemn fractal
#

i have it already

#

tried to use even tho also doesnt work

#

the bool is false as default even if i change to true

#

_finalBossO.isAlive

#

is always false here in this if as it never access it really

#

that is what is driving me crazy hahaha..

#

and I want to know when he dies not when he spawns

somber wren
#

still the same error ?

solemn fractal
#

no error now

#

but I dont access

silent idol
#

https://pastebin.com/xfy49H11

Why does this not activate a change of my scene?

    public void ChangeThisSceneToMyBuildIndex(int selectedBuildIndex)
    {
        ChangeSceneCoroutine(selectedBuildIndex);
    }
     IEnumerator ChangeSceneCoroutine(int selectedBuildIndex)
    {
        Debug.Log("Started Coroutine at timestamp : " + Time.time);
        yield return new WaitForSeconds(5);
        Debug.Log("Finished Coroutine at timestamp : " + Time.time);
        Debug.Log("Buildindex is " + selectedBuildIndex);
        mySceneTransferAnimatior.SetBool("FadeIn", true);
        SceneManager.LoadScene(selectedBuildIndex);
        mySceneTransferAnimatior.SetBool("FadeIn", false);
    }```
solemn fractal
#

the _finalBossO , i mean the values I get from it are the ones default

#

if I change it or he loses hp i always get the default ones.. I just dont know what to do anymore

keen dew
#

How do you know it has the default values? How did you check?

solemn fractal
#

debug.log

#

put it all the places u imagine

#

always give me 10 that is his default hp

keen dew
#

Yes but the thing is that I can imagine all kinds of things so you'll have to show what you actually did

solemn fractal
#

so the statment to check if the hp is <= 0 never happens as it is always 10

solemn fractal
# keen dew Yes but the thing is that I can imagine all kinds of things so you'll have to sh...

well I sent already the full code, and the method I created where I summon it and do the checks, i put the debug.logs there where it should happen and show the hp or even in places that doesnt make sense. I create like 10 debuglogs at the same time.. some didnt work obviously and the others that were in the correct place gave me 10.. and in the game I can hit him, and kill him,... he dies spawn the exp etc..

#

even on update or other places

keen dew
#

ok fine, show the FinalBossOne script

solemn fractal
#

ok the prob might be there, never shared here .. lets see

keen dew
#

In the FinalBossOne script put this in Update:

Debug.Log($"FinalBossOne: {name} hp is {_finalBOCurrentHealth}");

and in SpawnManager update put this:

if(_finalBossO != null) 
{
    Debug.Log($"SpawnManager: {_finallBossO.name} hp is {_finalBossO._finalBOCurrentHealth}");
}

Disable collapse in the console and show what it prints after the boss has taken damage

solemn fractal
#

oki doki. thank you!!! lets see

#

it shows the hp at 10 when he spawns and every time i hit him as I have 2 damage

#

shows 8

#

8...6...4...2..0

keen dew
#

Show a screenshot

solemn fractal
#

he dies and spawns a skill he spawns when he dies

keen dew
#

Disable collapse and try again

solemn fractal
#

ok but without collapse there are 3000 lines or more I cant take a ss of so many lines

keen dew
#

the last lines are enough

#

Even there it says the spawn manager printed only once, is the log not in Update?

solemn fractal
#

checking

#

the log is in update

#

both

#

what should i look for in the non collapsed console?

#

it just repeats things

#

and as the text is the same on both i cant tell u which is which

#

let me try to change the text inside the code u sent me to know

#

which is which

#

ahh ok sorry the text

keen dew
#

It's not the same

solemn fractal
#

is already dif

keen dew
#

Stop the game, scroll to the bottom and take a screenshot

solemn fractal
#

when he spawns or when he take any damage? I cant see on console the code I places on spawnManager

#

last lines

keen dew
#

Ok so _finalBossO is null

#

Post the current spawnmanager code again

solemn fractal
#

yup.. crazy stuff..

#

even if I try something like that ```cs
if (_FinalBossOne != null){
_finalBO = FindObjectOfType<FinalBossOne>();

} ```instead of assigning it to the inspector on the update method or creating a inumarator on start with while loop.. i cant get the updated values when he loses hp.. not sure anymore what to try

keen dew
#

ah.

#
_SpawnManager.gameObject.SetActive(false);
solemn fractal
#

omg i just thought about thuis

keen dew
#

The spawn manager isn't going to do anything if you disable it

solemn fractal
#

at the same time

#

i was looking to it now hahaha.. omg noway i missed that

#

you are a genius

#

now i need to figure it out a way to go around this.. because when he spawns i setactive to false as I want everything to stop spawning.. but maybe I will need to do that via code instead of disabling the spawnManger obejct

#

thank you my man for taking the time to hlep me out with that

#

apreciate a lot.. I will fix it, love you

keen dew
#

Glad you got it working

solemn fractal
#

will make it work yet but now I know why πŸ˜›

keen dew
#

Just a tip for the future, I always name my fields xxxPrefab if they're supposed to hold a prefab so that it's clear that it's not a scene object

solemn fractal
#

true, I should do that.. I will make those changes.

keen dew
#

Also the convention is that private fields have the _ underscore but public fields do not. The underscore just signifies that it's private

solemn fractal
#

yeah I am trying to do that always with the private ones so I visually can see which is which..

#

Thank you again !!

raven kindle
#

Hi, i am trying to make a game where the platforms automatically generate, and the charater is always moving, (endless runner)
I am wondering how i can link my script with the tilemap so that when it runs, the set tile is being used to build the endless platforms?
I am using this to generate platforms

void GenerateEndlessPlatform()
    {
        int currentX = 0;

        while (true)
        {
            for (int layer = 0; layer < layers; layer++)
            {
                if (Random.value < gapProbability)
                {
                    // Add a gap
                    currentX += gapWidth;
                }
                else
                {
                    // Add a platform
                    for (int i = 0; i < platformWidth; i++)
                    {
                        TileBase selectedTile = platformTiles[Random.Range(0, platformTiles.Length)];
                        tilemap.SetTile(new Vector3Int(currentX + i, layer * -gapWidth, 0), selectedTile);
                    }

                    currentX += platformWidth;
                }
            }

            // Add some space before the next set of platforms
            currentX += gapWidth;
        }
    }
#

there is 3 layers, and a 20% chance for a gap to appear

gaunt ice
#

and your editor freezes
generate it in update or after player move

raven kindle
#

ah ok

#

but how would i actually link the script to the correct tile

solemn fractal
# keen dew ah.

even tho now spawnManager never gets Inactive isnt working. I will try until tomorrow some stuff, if doesnt work I will need to come back here and cry again asking for help . 🀣

loud epoch
#

so it will always be null and the if-statement will never be true

solemn fractal
solemn fractal
solemn fractal
#
        // Spawn Slimes schedule with increased rate after killing boss
        if (_finalBossO != null){
            if (_finalBossO.isDead && _canSpawnSlime){
                Debug.Log("I AM IN!!!");
                Destroy(_finalBossO.gameObject);
                _coroutineSlime = StartCoroutine(SpawnSlimes(0.5f));
                _canSpawnSlime = false;
            }
        }```
raven kindle
tight ruin
#

Hey Everyone, Is there a Place I can ask questions about Python for Unity ?

gaunt ice
#

maybe unity talk, guess they dont redirect you back to code-general/advanced channel

sly ember
#

Hey, I'm quite new to Unity and have set up a basic "stealth" game where you avoid cameras vision cones. For now I'm happy with this and want to work on adding some patrolling guards. Before I do that however, I was wondering what the best way to "occlude" the vision cones (just a sprite) from going behind the black walls and outside of the map too.

There's also another bug which I think would be solved with a raycast, but currently the vision cones can detect players through walls

static cedar
#

You can do python in unity? UnityChanThink

wintry vessel
#

Is Anyone Available to Help Me With A Build And run Error

tight ruin
coral horizon
#
using System.Collections.Generic;
using UnityEngine;
using DG.Tweening;
using Cinemachine;

public class ParticleCollision : MonoBehaviour
{
    private ParticleSystem part;
    public List<ParticleCollisionEvent> collisionEvents;
    public CinemachineVirtualCamera cam;
    public GameObject explosionPrefab;

    void Start()
    {
        part = GetComponent<ParticleSystem>();
        collisionEvents = new List<ParticleCollisionEvent>();
    }

    void OnParticleCollision(GameObject other)
    {
        int numCollisionEvents = part.GetCollisionEvents(other, collisionEvents);

        GameObject explosion = Instantiate(explosionPrefab, collisionEvents[0].intersection, Quaternion.identity);

        ParticleSystem p = explosion.GetComponent<ParticleSystem>();
        var pmain = p.main;

        cam.GetComponent<CinemachineImpulseSource>().GenerateImpulse();

        if (other.GetComponent<Rigidbody2D>() != null)
            other.GetComponent<Rigidbody2D>().AddForceAtPosition(collisionEvents[0].intersection * 10 - transform.position, collisionEvents[0].intersection + Vector3.up);

    }
}
cosmic dagger
fossil drum
coral horizon
#

oh i see alright thank you guys

cosmic dagger
# coral horizon oh i see alright thank you guys

maybe this is what you want?

var position = collisionEvents[0].intersection;
var direction = (position - transform.position) * 10f;
AddForceAtPosition(direction * 10f, position + Vector3.up);
wintry vessel
#

anyone know what this error message is (unity)

#

Build completed with a result of 'Failed' in 34 seconds (33613 ms)
5 errors
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

fossil drum
#

I don't think he's talking about the force part, the force part is hitting the boxes already.
I think hes talking about the fact his bullet always goes to the right.

fossil drum
coral horizon
#

im still fixing it

wintry vessel
fossil drum
# coral horizon im still fixing it

Well the idea of RandomDiscordInvader is correct, you can calculate the direction that way. Just put that into the part where you spawn the bullet.

fossil drum
burnt vapor
wintry vessel
cosmic dagger
#

oh, well, none of the code shows anything about the bullets?

burnt vapor
#

There are more errors than that

fossil drum
#

Yeah, that was confusing for me too UnityChanLOL

fossil drum
# wintry vessel

Click one of the errors before that. For example the 4 errors one.

burnt vapor
# wintry vessel

Show all the errors, and the stacktrace. It might be the first error, it might be another one. Who knows.

wintry vessel
#

An asset is marked with HideFlags.DontSave but is included in the build: Asset: 'Assets/Horror FPS KIT/HFPS Assets/Content/Textures/UI/Menu/Floppy02.png' Asset name: Floppy02 (You are probably referencing internal Unity data in your build.) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

#

thats the first one

burnt vapor
#

Are you using any plugins or libraries?

#

I suggest you try deleting your library folder

wintry vessel
burnt vapor
#

Which ones? Easy Save?

wintry vessel
#

the save system is from Horror FPS KIT

burnt vapor
#

Yeah try deleting your library folder and project settings and try again

#

I suggest you do back up your project settings

solemn fractal
#

hey guys, first time getting this error here. Didnt really change anything regading that at all.. but now I got this prob.. and its pointing me out to this part cs for (int i = _BossOneList.Count - 1; i >= 0; i--){ BossOne bossOne = _BossOneList[i]; if (bossOne != null){ Destroy(bossOne.gameObject); _BossOneList.RemoveAt(i); } } was working fine.. didnt change anything related to it.. no idea why i receive that message. any ideas?

gaunt ice
#

you are trying to delete some prefabs in your disk

solemn fractal
solemn fractal
# gaunt ice you are trying to delete some prefabs in your disk

How? here I am adding the instantiated object to a list ```cs
private void InvokeBossOne(){

    Instantiate(_boss, new Vector3(_player.transform.position.x, _player.transform.position.y + 50, 0), Quaternion.identity);
    _boss._bossOnecurrentHealth = _boss._bossOnecurrentHealth * 3f;
    _boss._bossOnehealthTotal = _boss._bossOnehealthTotal * 3f;
    _BossOneList.Add(_boss);
    
} ```and here I am trying to delete those instantiated added to the list, why it would try to delete the prefab in my harddrive? ```cs
    for (int i = _BossOneList.Count - 1; i >= 0; i--){
        BossOne bossOne = _BossOneList[i];
        if (bossOne != null){
            Destroy(bossOne.gameObject);
            _BossOneList.RemoveAt(i);
        }
    } ```
rich adder
solemn fractal
#

oh I am not

#

true.. omg 😦 ok thank you

rich adder
#

yes you're passing _boss around which is a prefab πŸ˜‰

solemn fractal
#

yes yes true, i already corrected here .. thank you !!

wintry quarry
cosmic dagger
solemn fractal
solemn fractal
#

I will do that today prob. thank you guys

bitter canyon
#

hey guys, how do i make a variable that can be stored between play sessions

cosmic dagger
cosmic dagger
blissful trail
blissful trail
eager elm
rich adder
bitter canyon
#

i just found a video for the exact thing im trying to do

stuck palm
#

how can i assign 2 different player actors 2 different inputs?

sly ember
solemn fractal
rich adder
sly ember
rich adder
# sly ember Is that also able to be a collider2d?

You can do it by drawing mesh, codemonkey has tutorial on it

βœ… Get the Project files and Utilities at https://unitycodemonkey.com/video.php?v=CSeUMTaNFYk
Let's make an awesome Line of Sight effect that interacts with walls, enemies outside the Field of View are not visible. Excellent effect for any sort of Stealth or Horror game.

Get Survivor Squad and Survivor Squad: Gauntlets in the Game Bundle
https:/...

β–Ά Play video
bitter canyon
fathom dock
#

private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.CompareTag("Curse"))
{
JunpeiScript junpei = collision.GetComponent<JunpeiScript>();
JogoatScript jogoat = collision.GetComponent<JogoatScript>();

        if (junpei != null)
        {
            junpei.DisableMovement();
            currentCollision = collision; 
            Invoke("ApplyDamage", DelayTime);
        }

        if (jogoat != null)
        {
            jogoat.DisableMovement();
            currentCollision = collision;
            Invoke("ApplyDamage", DelayTime);
            

        
           
        }
        else
        {
            float totalAnimationDuration = animationlength + extendedLastFrameDuration + 1;
            Invoke("Move", totalAnimationDuration);
        }

    }
}

Hello, so I want my Character to be moving after the animation that he is in because during that time his movement gets disabled but i dont manage to get him walking again

#

public void DisableMovement()
{
originalDistance = distancebetween;

    distancebetween = 0;
    
}

public void EnableMovement()
{
    distancebetween = originalDistance;
}
#

Heres the other code for his movement

rich adder
eternal falconBOT
rich adder
bitter canyon
#

mb

rich adder
#

also Unity methods are case sensitive

bitter canyon
#

did i mess somethin up with capitals?

#

darn

rich adder
#

/ c# in general is case sensitive

rich adder
bitter canyon
#

i didnt confuse Highscore and HighScore did i

rich adder
#

nope

#

methods SHOULD always be capitalized

summer stump
bitter canyon
#

oh ffs

#

im dumb

#

and blind

rich adder
#

you might want that in awake tho

bitter canyon
#

whas the difference between start and awake

summer stump
rich adder
#

awake is better suited for initialization

bitter canyon
#

oh ok

rich adder
#

this way if you have other scripts that rely on this info they can get it in start

#

this way the value is guaranteed set already

bitter canyon
#

so if i build this and run it now it should save right

rich adder
#

saving wasnt the issue

#

it was probably saving regardless

bitter canyon
#

well i mean just do what i want it do

#

i word things wrong sometimes

rich adder
bitter canyon
#

ye thats fair

rich adder
#

the problem is you're not loading the actual value

#

yu are only loading it to display it on Text

#

you don't actually load your value back in the variable

bitter canyon
#

aaaand it says 0 when i boot it up again after playing

#

darnit

rich adder
bitter canyon
#

it doesnt need to load score on boot it needs to load the high score

rich adder
#

whatever same thing

#

my point still applies

bitter canyon
#

i mustve read somethin wrong

rich adder
#

look at your logic rn

#

carefully

bitter canyon
#

wait highscore isnt an it

#

its a float

rich adder
#

there is also that yes

#

your highscore will always be 0 regardless

bitter canyon
#

oh i thought that was setting default

rich adder
#

setting it isn't the issue

rich adder
bitter canyon
#

does line 26 not do that?

rich adder
#

cause right now it will always be a new highscore on each load

rich adder
#

you're saving it, like I said thats not an issue

bitter canyon
#

so to clarify the problem is loading it?

rich adder
#

yes

#

nowhere is that happening

bitter canyon
#

so i need to change the awake method to set the float highscore

#

not the text

rich adder
#

I suppose you can call it set, but for keeping with the PlayerPrefs pattern

#

its Get

#

getting the value into highscore

bitter canyon
#

would this be written out correctly or am i bein dumb still

rich adder
#

is Highscore a string ?

bitter canyon
#

it needs to be written out to a ui

rich adder
#

not my question

bitter canyon
#

oh mb

#

Highscore is a float

rich adder
#

right so why would it have ToString

bitter canyon
#

i think the tutorial i was tryin to follow was writing straight to text instead of setting a value

#

i got mixed up ig

rich adder
#

regardless that would not make sense because why would you only write the text but never actually change the value

#

the highscore will display say 40 but your starting highscore will be 0

#

if you try to save 20 it will work

#

since 20 > 0

#

and you overwrite 40

bitter canyon
#

wait

#

but once i get the highscore shouldnt it know what value to need to be over

rich adder
#

which you aren't

bitter canyon
#

ye ik i need to remove tostring

rich adder
rich adder
sly ember
subtle folio
#

Hi, i am trying to implement a save and load system using json. i can save the data i want just fine into the json, but when deserializing it, it cannot populate the list properly

eternal falconBOT
woeful hedge
#
    private void OnCollisionStart2D(Collision2D collision2D)
    {
        Debug.Log(collision2D.gameObject.name);
        if (collision2D.gameObject.tag == "Boss")
        {
            doesShotHitted = true;
        }

    }

    private void OnCollisionStay2D(Collision2D collision2D)
    {
        Debug.Log(collision2D.gameObject.name);
        if (collision2D.gameObject.tag == "Boss")
        {
            doesShotHitted = true;
        }
    }

    private void OnCollisionExit2D(Collision2D collision2D)
    {
        Debug.Log(collision2D.gameObject.name);
        if (collision2D.gameObject.tag == "Boss")
        {
            doesShotHitted = false;
        }
    }

I just checking the Collisions and they does not make events and run functions
What should I do to solve this?

bitter canyon
rich adder
subtle folio
# subtle folio Hi, i am trying to implement a save and load system using json. i can save the d...
using Newtonsoft.Json;
using System.Collections.Generic;
using System.IO;
using System;

public class SceneObjectLoader : MonoBehaviour
{
    public string loadFileName = "save_objects.json";

    public void LoadObjectsFromJson()
    {
        string loadPath = Path.Combine(Application.persistentDataPath, loadFileName);
        if (File.Exists(loadPath))
        {
           
            
                string json = File.ReadAllText(loadPath);
                Debug.Log(json);

                List<Saver> savedObjects = JsonConvert.DeserializeObject<List<Saver>>(json);
                Debug.Log(savedObjects.Count);
                if (savedObjects != null)
                {
                    foreach (Saver savedObject in savedObjects)
                    {
                        string fullPath = Path.Combine(savedObject.path, savedObject.name);

                        Debug.Log(fullPath);
                        Debug.Log(savedObject.posX);

                        GameObject prefabToInstantiate = Resources.Load<GameObject>(fullPath);

                        if (prefabToInstantiate != null)
                        {
                            Vector3 position = new Vector3(savedObject.posX, savedObject.posY, savedObject.posZ);
                            Instantiate(prefabToInstantiate, position, Quaternion.identity);
                        }
                        else
                        {
                            Debug.LogWarning("Prefab not found for path: " + fullPath);
                        }
                    }
                }
            
        }
        else
        {
            Debug.LogWarning("Save file not found: " + loadPath);
        }
    }

}```
bitter canyon
#

oh cool

rich adder
#

this is annoying to keep scrolling to reference

bitter canyon
#

lets go it works now

#

thanks for workin with me i know sometimes i be a bit dumb

#

first time im making somethin in unity

#

or any coding stuff

subtle folio
rich adder
rich adder
#

its hard to look at code for me through discord :\

bitter canyon
#

the websites have the pretty coding colors lol

languid spire
woeful hedge
rich adder
#

are none of the debugs printing at all ?

bitter canyon
#

i actually do have a question, if i zip the file ive built my game into, after playing, and sent it over, would it have my highscore logged in it?

bitter canyon
#

oh i could probably fix that by using a fresh build

#

oh ok

#

ty

woeful hedge
#

no I checked only some steps
Nothing is printed in Debugs now
will check and get back later

rich adder
#

in Macos is Application Support. etc

bitter canyon
#

i should add a changlog in my files i can never remember what i change

rich adder
#

well you need Version Control

#

this tracks your project for any changes

#

even if you change a comma, it will track everything and you can revert

bitter canyon
#

yeah i got a discord server ive been posting new builds in

#

oh wait is that like a program

rich adder
#

not a reliable way

subtle folio
rich adder
#

think Github

languid spire
#

so the error is in the constructor of your Saver script. not in the code you posted

woeful hedge
#

seems like using transform.position issue but this thing does not has Rigidbody

#

wait

bitter canyon
languid spire
north kiln
subtle folio
woeful hedge
amber veldt
#

Hey guys, how do you set the position/rotation and scale of a gameObject at the same time ?

rich adder
#

although it should still work

amber veldt
rich adder
#

yes

#

idk if they had that

#

but just make an extension function maybe or something

amber veldt
#

That's what I thought! Maybe just add to the SetPositionAndRotation function since it's apparently more efficient

woeful hedge
autumn dew
rich adder
#

or add force

woeful hedge
#

when if I dont use Rigidbody?

rich adder
#

then why do you expect collisions messages to work

true pasture
#

would I be able to set those stats in the inspector that way?

woeful hedge
#

other collider has Rigidbody2D

#

should I make them to have Rigidbody2D both

rich adder
rich adder
#

whichever has movement they should have rigidbody

woeful hedge
#

Player does not have Rigid2D
Boss(Wakamo) has Rigid2D
and Player can move at this time but they will move both soon

#

so I should Have to make them have RigidBody2D both uh

rich adder
#

yes

#

physics messages shuld still work

#

if at least 1 in collision has it but yeah moving transforms might be causing the miss

woeful hedge
#

and movePosition() does not work as same as transform.position = ();
I should have to try AddForce() now ahh

rich adder
#

AddForce / Velocity aare usually when its dynamic

#

MovePosition for Kinematic

woeful hedge
#
  IEnumerator Move(float duration)
    {
        // end of the board
        if (m_Position_End.x > LimitX) m_Position_End.x = LimitX;
        else if (m_Position_End.x < -LimitX) m_Position_End.x = -LimitX;
        if (m_Position_End.y > LimitY) m_Position_End.y = LimitY;
        else if (m_Position_End.y < -LimitY) m_Position_End.y = -LimitY;

        Debug.Log(UnmoveablePositions.Count);
        //Blocked By block
        foreach (Vector3 enemyPosition in UnmoveablePositions)
        {
            Debug.Log("MPOSEND - " + m_Position_End + " / " + enemyPosition);
            if (m_Position_End == enemyPosition)
            {
                m_Position_End = m_Position_Default;
                break;
            }
        }

        var runTime = 0.0f;

        while (runTime < duration)
        {
            runTime += Time.deltaTime;

            gameObject.GetComponent<Rigidbody2D>().MovePosition(Vector3.Lerp(m_Position_Default, m_Position_End, runTime / duration));
            //transform.position = Vector3.Lerp(m_Position_Default, m_Position_End, runTime / duration);

            yield return null;
        }

        CorrectionPosition();
    }```
rich adder
#

that getComponent every frame 😬

woeful hedge
#

I move Player like this and yield return null; might cause the issue that result of the transform.position / Moveposition; are different

woeful hedge
rich adder
#

is your player kinematic ?

woeful hedge
#

yes

rich adder
#

.MovePosition iirc is WorldPos

#

so you need to still make it localpos

woeful hedge
#

uhh result of the using movePosition() is different when I use transform.position

rich adder
#

to your local pos

edgy prism
#

Hello so Im working on a selection of 6 sliders where I want to limit the max value of all of them to a certain number my code currently does that but I cant figure out how to then allow decreasing but not further increasing of the sliders

else if (!summaryCapta.CheckTotalEV())
        {

            foreach (Slider slider in evSliders)
            {
                // Check if the new value is less than the current value before updating
                float newValue = Mathf.Round(slider.value / 4.0f) * 4.0f;
                if (newValue < slider.value)
                {
                    slider.value = newValue;
                }
                else
                {
                    evSliders[0].value = summaryCapta.EV_HP;
                    evSliders[1].value = summaryCapta.EV_ATK;
                    evSliders[2].value = summaryCapta.EV_DEF;
                    evSliders[3].value = summaryCapta.EV_SPA;
                    evSliders[4].value = summaryCapta.EV_SPD;
                    evSliders[5].value = summaryCapta.EV_SPE;
                }
            }

        }
woeful hedge
#

you mean add to Vector3.Lerp(...) into my localpos ?

rich adder
#

because it should work

woeful hedge
#

it move less

rich adder
#

wdym less

woeful hedge
#

it is what i expected

#

and using Moveposition() looks like:

rich adder
woeful hedge
#

I think it is related to yield return null; make Coroutine run at next frame = Update
(web said MovePosition() should run with FixedUpdate)

woeful hedge
#

nothing special

#

wait I need to try yieldΒ returnΒ newΒ WaitForFixedUpdate()

rich adder
# woeful hedge

ohh Its because you never actually stop when reached I think

#

wait

#

no

woeful hedge
#

So I just solved this and need to check collider works well

rich adder
#

Oh okay thats good

woeful hedge
#

annnd the collider does still not works

rich adder
#

show me what it looks like

woeful hedge
#

wait

#

Player

#

ahh

#

damn

rich adder
#

idk if Id call that "quickly" but sure

#

btw i tried this and it works way better

#
IEnumerator LerpPosition(Vector3 targetPosition, float duration)
    {
        float time = 0;
        Vector3 startPosition = transform.position;
        while (time < duration)
        {
            rb.MovePosition(Vector3.Lerp(startPosition, targetPosition, time / duration));
            time += Time.fixedDeltaTime;
            yield return new WaitForFixedUpdate();
        }
        rb.MovePosition(targetPosition);
    }```
#

just tested it

private void Update()
    {
        if (Input.GetKeyDown(KeyCode.W))
        {
            StartCoroutine(LerpPosition(transform.position + new Vector3(0, 1, 0), 0.1f));

        }
    }```
woeful hedge
rich adder
woeful hedge
rich adder
woeful hedge
#

I just cant receive OnCollision2Denter/stay/exit messages

#
   private void OnCollisionStart2D(Collision2D collision2D)
    {
        Debug.Log(collision2D.gameObject.name);
        if (collision2D.gameObject.CompareTag("Boss"))
        {
            doesShotHitted = true;
        }

    }

    private void OnCollisionStay2D(Collision2D collision2D)
    {
        Debug.Log(collision2D.gameObject.name);
        if (collision2D.gameObject.CompareTag("Boss"))
        {
            doesShotHitted = true;
        }
    }

    private void OnCollisionExit2D(Collision2D collision2D)
    {
        Debug.Log(collision2D.gameObject.name);
        if (collision2D.gameObject.CompareTag("Boss"))
        {
            doesShotHitted = false;
        }
    }```
rich adder
#

Kinematic + Kinematic = NoCollision messages

woeful hedge
#

oh I saw but I missed πŸ’€

#

finally It works

#

I'm trying to check docs as carefully as I can

#

well but I miss always

#

sorry but It was useful

#

anyways I changed future bugs because of you

rich adder
scarlet skiff
#

Β¨how do i make the simplest one second timer? like to make a code run only every second

woeful hedge
#

Thanks

woeful hedge
rich adder
subtle folio
#

i want to save which scene/level the player is currently in through a json file, any pointers that i should look into on how to do it?

rich adder
cunning heath
#

Hey where do I ask a doubt that isn't coding related but only partially related to Unity but comes under game Dev of UI with external plugins.

cunning heath
desert elm
#

I've been told that to find the distance between two game objects, I should just have unity compute it instead of using a raycast- so, how do I do that?

unique hull
#

Just need to use two vector3's

desert elm
#

Thanks for the help

unique hull
ripe nymph
#

I'm trying to get a new tile to spawn every 1 unit travelled by the player, but i cant get it to work

#

i tried with Mathf first as well, but didn't work

#

How can i reliably get my next sprite to spawn every 1 unit is my question

eager elm
#
if (player.transform.position.x > positionGround.x)
{
    positionGround.x++;
    Paint();
}```
#

@ripe nymph

queen adder
#

how would I make it that after a "chase" the enemy goes to the nearest note, and then continues the path?

ripe oyster
#

Hi! I commissioned someone to make some code for me. In 2019, is it possible for a GUI drag section to detect if a folder has been dragged in? The coder says he has been trying a lot but he just can't do it. Is it possible at all?

ripe oyster
rich adder
#

yes this question better fits that channel as its a custom editor script

#

I didn't even know you could make dropzone hotspots, gonna look into that :😈

ripe oyster
#

Gotcha

ripe oyster
rich adder
#

Oh wait didn't we do this one together ?

#

or before the dropzone thing anyway

solemn fractal
#

Hey guys.. for not I am using 1 prefab that is spawning 4 dif enemies.. and I am using a scriptable object to control their size, color and sprite. BUT now I want to add some animation to them. I will need to create dif prefabs or I can still assign dif animation to them with the preset I have?

halcyon osprey
#

Trying to learn about scene triggers after just learning about camera and player movement. By far the hardest thing to grasp. I could just copy and paste the code and follow the steps but I'm tryna at least understand how it works

ripe oyster
halcyon osprey
#

No question, just discussing where I stand as a beginner. I'm going to try my best to learn about it myself before asking for help

cosmic dagger
queen adder
#

So I am making a horror game where the enemy is patrolling on a waypoint note path. I made it so that when the player is in a certain range of the enemy it will chase the player. The problem with this is when the player escaped, and the enemy stops chasing it returns to the note point where he started chasing the player. This causes him to walk trough walls. What do I need to do so that the enemy starts with the closest note array point that is the nearest of him and continues the array loop from there?

solemn fractal
ripe oyster
cosmic dagger
solemn fractal
cosmic dagger
#

maybe, it depends what data your SO has and how the component uses it . . .

solemn fractal
#

things like that

#

would be nice if instead of SPRITE I could add a field for animation there

#

and just add the animation there

rich adder
solemn fractal
rotund hull
#

i am trying to make a mining game with lots of blocks but it takes a long time to load, how can i speed it up

summer stump
sage mirage
#

How to save Game Music volume slider changes?

clever breach
#

O Script de CameraController logo abaixo, basta copiar e colar...

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

public class CameraController : MonoBehaviour
{
public Transform player;
public float alturaCamera = 1.3f;
public float Sensibilidade = 300.0f;
public float LimiteRotacao = 45.0f;
float rotX;
float rotY;

void Start()
{
    Cursor.lockState = CursorLockMode.Locked;
}

void Update()
{
    float MouseX = Input.GetAxis("Mouse X");
    float MouseY = Input.GetAxis("Mouse Y");

    rotX += MouseX * Sensibilidade * Time.deltaTime;
    rotY -= MouseY * Sensibilidade * Time.deltaTime;

    rotY = Mathf.Clamp(rotY, -LimiteRotacao, LimiteRotacao);
    transform.rotation = Quaternion.Euler(rotY, rotX, 0);
}

private void LateUpdate()
{
    transform.position = player.position + player.up * alturaCamera;
}

}

#

@timber tide

timber tide
#

also probably want to format it

#

!code

eternal falconBOT
timber tide
#

You'd probably want to go over the tutorial again and see the exact object they're dragging onto the camera component. What it seems here is you want a type of Transform which is not a type of Player.

#

They're probably dragging a scene object (gameobject) onto the camera script, and that scene object may have the Player script included on it.

clever breach
#

I must have skipped some part or done something wrong, I'm going to look for another tutorial because I don't understand

wintry quarry
true pasture
#

would it be possible to run OnTriggerEnter using whatever I put here as the trigger being entered?

timber tide
#

Like making class that implements a Trigger() method and then deriving from?

copper perch
timber tide
#

red text bad

#

fix

languid spire
#

you have compile errors

true pasture
verbal dome
#

The ontriggerenter message gets sent to the object that has the rigidbody, if it has one

noble urchin
#

what is the best way to spawn random objects on a procedurally generated terrian(not using terrain object)

short hazel
#

If the terrain has a collider, then you can raycast downwards from a high position to get the altitude at which you need to spawn the object

noble urchin
#

it does have collider but all my objects just spawn at 1 position

short hazel
#

You have quite the amount of errors here

#

Seems like you're dividing a vector by zero (which sets all its values to Infinity) before passing it to Instantiate

ripe oyster
noble urchin
#

thats my code

#

im using mathf.inifity to raycast it

short hazel
#

Ah I see what's happening I think. SamplePosition failed to find a valid position

#

That returns a bool, you should use it to know whether the operation was successful

#
if (!NavMesh.SamplePosition(stuff...))
{
    Debug.LogError("Failed to sample position!");
    return Vector3.zero;
}
#

The first message in your Console indicates that the Nav Mesh couldn't be created

#

Well, the agent you're trying to place did not find a valid NavMesh

#

So the errors are related to the warning, or vice-versa

noble urchin
#

but i can move a cube around the terrain with navmeshagent

verbal dome
#

Try using a downwards raycast

#

And if you want, try SamplePosition on that raycast's hit position. Not necessary though

#

I'm talking about Physics.Raycast

#

Alternatively you can sample whatever heightmap you used to generate the map, but that's a bit more complex

rich adder
short hazel
ripe oyster
#

It doesn't seem to let me

rich adder
#

On the Clips label? @ripe oyster

short hazel
#

ok

#

message deleted lol

solemn fractal
#

Sorry hahaha

short hazel
#

was in the middle of answering

sly wasp
#

Hi, I’d like some help with child and parent scripting please.
So let’s say I have a cup, and then I have a character that is rigged. How would I do a script to where the cup is put into a bone of the game object (character)?

solemn fractal
#

I already discovered why

solemn fractal
#

that was the mistake

#

πŸ˜›

ripe oyster
short hazel
# solemn fractal that was the mistake

Technically, transform.position returns a copy of the vector, modifying one of its value would do nothing (as you edit a copy), so C# prevents that by reporting the error you're getting

solemn fractal
#

fixed already ty

rich adder
ripe oyster
#

Its also cause I wanted to drag folders in, and I wanted the get all button fixed, thats why I commissioned in the end

rich adder
sly wasp
verbal dome
#

Then you can assign it in the inspector

#

[SerializeField] Transform bone;

rich adder
#

[SerializeField] private Transform bone

sly wasp
#

I just tell it the bone name?

ripe oyster
# rich adder

It must've worked in your version, i don't think the mod kept it in

verbal dome
#

You declare the variable (like shown above) and then drag it into the slot in the inspector

rich adder
short hazel
sly wasp
rich adder
short hazel
#

Before that version, it refuses to do that unless the collection is empty

#

Making it not additive

rich adder
#

ah thats balls gladd they fixed it

#

they are on 2019

verbal dome
rich adder
#

so its suspicious

#

but maybe someone they give it to just broke the custom inspector window xD

sly wasp
#

I already figured that out

verbal dome
#

Do you want to find the bone from the player sort of automatically?

sly wasp
#

Just need the script to find a bone in that object and make the cup that has the script on it be a child of it

verbal dome
sly wasp
verbal dome
#

Then reference that script with the correct type and use player.bone to access it

#

Needs to be public though

#

I don't know what a "cup" means in this context though

#

A cup that the bone holds?

sly wasp
#

Yes

#

I’m just using it as an example for better understanding

verbal dome
#

I feel like the parenting should be done in the player's script, not in the item itself

#

Showing your current code would help me help you

sly wasp
#

public GameObject PLAYER;

PLAYER = GameObject.FindGameObjectWithTag(β€œPlayer”);

That’s all I got

short hazel
#

Yep things are done backwards

#

Player manages and interacts with the items, not the inverse

rich adder
#

also caps πŸ€•

short hazel
#

Oh god I just had a horrendous programming language idea
Allow devs to make the text bold, italic, underlined. Each one has a significance and modifies how the code works

#

I know it's been done with fonts, but not font style

#

void => public
void => protected
void => static

rich adder
#

not as crazy as emojicode i suppose xD

verbal dome
#

Thanks, I hate it

eternal needle
#

void => private

sly wasp
#

What

rich adder
sly wasp
#

I’m sorry, I’d like to not do it like that

#

I was meaning to navarone

short hazel
#

Unfortunately using Find should be the very last resort solution, in cases there are absolutely no other ways
The approach is flawed, what happens if you change the player's name? Everything breaks
And I'm not talking about the performance hit you'll get if there are 200 items with that script in the scene

#

Find searches the objects one by one throughout the entire scene

#

The correct way is to have a script on the player that detects the items, and parent them to whatever bone so you can "grab" them

solemn fractal
#

!code

eternal falconBOT
solemn fractal
#

hey guys, I am trying to limit my player to not get out of the screen when the boss spawn. But to be able to make sure that I know the bouderies of the screen I am using the boss position to calculate it. As I wuill be moving tru the map, he always spawn in Y +20 from me and the camera stop to follow me.. like that is not working, and I know why, but I cant think a way to fix it. any ideas? https://paste.ofcode.org/edXx3VjNJiTXF6XDaPS7sB

verbal dome
solemn fractal
#

i tried that, but the prob is that when I do that, they do not appear in the correct place

#

and they appear instead of straight

#

they appear kind of tilted to the side.

verbal dome
#

Btw these two if-statements do the same thing if (_spawnManager._finalBossO != null) and if (_spawnManager._finalBossO)

#

You could just remove thet second one

#

So does the boss always spawn in the same spot or does it depend on something?

solemn fractal
#

here

#

I posted it long ago asking here.. and if I was moving it would spawn to the side

#

like moving to the right it would spawn moer to the right and so. on.. I already deleted it.. I will try again that way and see if now works and abandon that way to restric the movement

verbal dome
#

Can't say much without seeing the code you use to spawn the walls

solemn fractal
#

true I will re make it and see if it works

#

thank you πŸ˜„

solemn fractal
verbal dome
#

Oh yeah

solemn fractal
#

I did it but when I touch the wall

#

it moves

verbal dome
#

I suggest using a rigidbody instead of moving it via transform

#

If you use a rigidbody, move it with rb.AddForce, rb.velocity or rb.MovePosition

#

Using transform will just make things glitch out

#

Or not detect collisions at all

solemn fractal
#

yeah but why when I touch the walls they move? how can I make them not move and just impede that I go to the other side?

verbal dome
solemn fractal
#

ah ok

verbal dome
#

If you do, make them kinematic. But it's not needed, just the player rigidbody is enough

solemn fractal
#

worked ty

steady arrow
#

What’s the best place to learn C# for Unity?

cosmic dagger
solemn fractal
verbal dome
queen adder
verbal dome
#

What do you want to store in it?

modest dust
#

seems like current is an index you're using for the notes array/list

#

Why do you want to store a distance in it now?

solemn fractal
modest dust
#

Also the error tells you exactly what you're doing wrong

#

current is an int variable type and you're trying to assign a float value to it

verbal dome
#

Yeah, you probably want to use a for loop and store the i in current instead

solemn fractal
# verbal dome How do you detect the touch?

the prob is that if I check the colission and give damage to the player on the enemy .. I wil need to take the on trigger on the enemy no? and that will cause other problems

verbal dome
#

The OnTriggerEnter can be on either object I think

#

Make sure you aren't moving anything via transform, use the rigidbody

solemn fractal
queen adder
solemn fractal
#

no idea what to do

queen adder
#

I am trying to make the nearest point the β€œcurrent” point

modest dust
#

Right now you're trying to assign distance to your index

verbal dome
solemn fractal
#

both have collider and trigger..

verbal dome
solemn fractal
#

ops collider and rigid body

modest dust
verbal dome
#

@solemn fractal Well there needs to be a collider with isTrigger checked if you want to use OnTriggerEnter

solemn fractal
#

before adding the rigidbody to the player all was good but he was not able to go tru the walls.. adding the rigid body with kinect worked for the walls but now he doesnt take damage from the enemies.. and the check for the damage is on the player

solemn fractal
verbal dome
#

You can have both, a trigger and a non-trigger collider

solemn fractal
#

oh really ?

#

No .. I added 2, one with istrigger and other without and I pass tru things

solemn fractal
verbal dome
solemn fractal
#

rigdbody velocity

verbal dome
static cedar
# queen adder

notes[i]
notes is an array, it's a group of stuff and you need to specify which one of the stuff you're using with [].

solemn fractal
queen adder
static cedar
verbal dome
solemn fractal
#

oh ok true

verbal dome
static cedar
#

I rarely find a use case for do ngl.

#

Not that you should be forced to use it.

verbal dome
#

Sometimes it's useful if you want to do something at least once

#

But yeah the syntax is so weird looking I just avoid it

queen adder
#

u guys don't use for or foreach?

static cedar
static cedar
verbal dome
queen adder
halcyon osprey
#

(Sorry for the pic dump, just trying to show the important bits) Not entirely sure what I've done wrong or what I can check for, the player simply phases through the triggers without anything happening. I'm attempting to switch scenes through a trigger

rare basin
#

Alteast one of the colliders need to have rigidbody2d

verbal dome
#

It needs to have a rigidbody and you need to move it with rigidbody methods/properties

rare basin
#

You don't need to move it with rb methods tho

#

It will work even if you modify the transform position

#

But it can be janky

verbal dome
#

Janky doesn't sound good

rare basin
#

Yup, but will work πŸ˜…

last edge
#

question, (for unity programming)

im trying to have a button that toggle and close an object and make that object be able to accept text input. when then display on another object what steps would i have to do for this?

#

something like this

timber tide
#

You'd look into using Unity's UI tools which includes adding a canvas to your scene

halcyon osprey
verbal dome
halcyon osprey
#

Yeye

verbal dome
#

Specifically, the object that has the collider must have the tag

halcyon osprey
#

Dude I feel ridiculous
The player didn't even have a collider in the first place, immediately after I gave it a collider it started working

#

hh

last edge
#

ooo thank you haha

#

i have a canvas and a few stuff set up now

solemn fractal
#

I love programming hahaha.. I am coding in a script that is not even related to a thing and the thing gets a bug.. hahaha.. just a random comment here.. sorry

verbal dome
#

That will happen less when you learn proper encapsulation

upper yoke
#

Hey, I'm trying to draw stuffs on top of my screen, I have the following code:

            Camera.onPostRender += OnPostRenderCallback;
        }

        private void OnPostRenderCallback(Camera c)
        {
            GL.PushMatrix();
            _blackMat.SetPass(0);
            GL.LoadOrtho();

            GL.Begin(GL.QUADS);
            GL.Vertex(Vector2.zero);
            GL.Vertex(Vector2.right);
            GL.Vertex(Vector2.one);
            GL.Vertex(Vector2.up);
            GL.End();
            
            GL.Begin(GL.TRIANGLE_STRIP);
            GL.End();
            GL.PopMatrix();
        }

But when I have the SetPass it does nothing, however without it my screen is black as it should be
The material applied is just a standard one, am I missing something?

verbal dome
upper yoke
#

The default one

formal escarp
#

Hi, sorry but im really confused. I have this script attached to my player, and i have an empty which is a prefab, and has 3 children. The 3 empty children have 3 items named "Latita1" "Latita2" and "Latita3" but it does not detect collision and the items do not dissapear as it should.

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

public class CocaCola : MonoBehaviour
{
    public GameObject CocaColaCoso;
    private void OnTriggerEnter(Collider other)
    {
        Debug.Log("OnTriggerEnter called");
        if (other.gameObject.CompareTag("Item"))
        {
            Debug.Log("Item detected");
            Destroy(other.gameObject);
            for (int i = 1; i <= 3; i++)
            {
                StartCoroutine(DisappearAndReappear(other.transform.Find("Latita" + i).GetComponent<MeshRenderer>(), i));
            }
        }
    }

    private IEnumerator DisappearAndReappear(MeshRenderer meshRenderer, int partNumber)
    {
        yield return new WaitForSeconds(0.5f * partNumber);
        meshRenderer.material.color = Color.clear;
        yield return new WaitForSeconds(0.5f);
        meshRenderer.material.color = Color.white;
    }
}
#

Not sure what im missing.

wintry quarry
verbal dome
#

Not sure if it matters

upper yoke
verbal dome
#

It probably has to support vertex colors at least

upper yoke
verbal dome
#

I also thought that birp uses OnPostRender

upper yoke
#

Yep changing my material to UI/Default

#

While I'm here would you know if it's possible to then redraw on it and cancel out the previous draw?
My original goal was to do some "fog" effect by drawing a black square then canceling the areas I want to see

verbal dome
#

Sounds like you would need something "stencil" related

#

Not sure if it's possible with GL lines though

upper yoke
#

Hmm well it's a good start I'll look at that
Thanks again :)

formal escarp
#

hey guys i have a question, i have some code that when you touch a certain item with a tag on it, it dissapears. how can i make it so it goes 1/3 2/3 and 3/3?

queen adder
#

How much worse if gameObject.SendMessage("method") than gameObject.GetComponent<yourMB>().method()?

#

anyone benchmarked it before?

verbal dome
#

You want it to disappear one third at a t ime?

formal escarp
#

no no.

verbal dome
#

Or want to touch it 3 times before it disappears?

formal escarp
#

like, i touch item. it dissapears. and you can see a counter if you can call it that that goes 1/3.

#

You touch the second one, boom. 2/3.

queen adder
#

like a coin counter

formal escarp
#

yeah.

#

if you say it like that it sounds easier.

queen adder
verbal dome
#

Increment an integer in the player script each time you touch one, for example

formal escarp
#

wait its a 3D project.

formal escarp
queen adder
#

have some things to change, but shouldnt be too hard as long as you understand the concept of triggers

#

the counter is easy to implement, the collection is the slightly harder one

verbal dome
#

Should be pretty much the same except you have to use the 3D methods, so OnTriggerEnter instead of OnTriggerEnter2D etc.
But sounds like you already have that in place

wintry quarry
queen adder
#

are there still even a possible usecase for it?

#

I wonder why it's still not deprecated/removed

last edge
#

hey guys im using a textinputfield tmp. on unity how do i make it so i i can click enter and it goes on a new line?

timber tide
#

SendMessage for when you're testing stuff out on your throw away project

last edge
#

wdym?

timber tide
#

was replying above

last edge
#

oh

timber tide
#

you'd probably need to add an escape sequence '\n' to the text

last edge
#

how do i add that to the textmeshpro? just drag a script onto it?

timber tide
#

you just edit the text directly from the instance

#

tmpro.text or w/e

last edge
#

like in my inspecter?

#

because it doesnt have a script to it atm

timber tide
#

You need to make a script that you can call on your button event

queen adder
#

oh right, you can use the sendmessage to make a custom editoronly stuff that can call methods without contextmenu

last edge
#

well, the thing is im just using the textinput as like a design option for the user to see since theres no output

#

does that mean i need to attach it to an object?

timber tide
#

it needs to be on a gameobject that contains or is a child of a canvas gameobject

last edge
#

its on a canvas

timber tide
#

Now you need a script

#

You can do a lot with the UI and scene alone, but what you want is very specific logic, so you need to code it in.

last edge
#

i have this script that should make it entered a new line but idk why it doesnt

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class textmeshpro_newline : MonoBehaviour
{
public TMP_InputField inputField;
public TMP_Text outputText;

public void Start()
{
    if (inputField != null) inputField.onEndEdit.AddListener(text => { if (outputText != null) { outputText.text += text + "\n"; inputField.text = ""; } });
}

}

timber tide
#

so this would newline when you stop editing

#

oh this is tmp_inputfield though uh

#

one day someone will update the tmpro documentation with some actual wording

#

but imma go with the assumption that it behaves similarly

last edge
#

thank you for the help

formal escarp
#

i fucking love when the tutorial i see fails, and i fix the code.

#

its like eating a KFC family bucket at 3 AM. Nothing can beat the feeling.

queen adder
#

How to linebreak in a Text via code?

#

omg, apparently, unity uses the actual linebreak special character to line break on TextAreas

cosmic dagger
#

just use the Environment.NewLine . . .

quasi rose
primal turtle
verbal dome
#

Possibly unrelated, but checks like this Input.GetAxis("Horizontal") > 0 might be inaccurate especially if your joystick is damaged at all (very common)

#

For example, it could be stuck at 0.001 when you aren't touching the stick

primal turtle
#

Okay, what would you recommend?

verbal dome
#

Though I think you can configure that in the axis settings too

primal turtle
#

Okay, will that fix the moving problem?

verbal dome
#

I doubt it, but do it anyway

#

I can't see what's wrong right now, you can try asking again tomorrow/in a few hours when more people are online

#

Context for others: movement works with keyboard but not with joystick

#

This might be problematic```cs

    if (movementLeftRight < 0.5 && movementLeftRight > -0.5 && Input.GetKey(KeyCode.A) == false && Input.GetKey(KeyCode.D) == false && Input.GetKey(KeyCode.LeftArrow) == false && Input.GetKey(KeyCode.RightArrow) == false)
    {
        movementLeftRight = 0;
    }```
#

You are doing keyboard-specific checks here

primal turtle
#

Ah, forgot to change that.

primal turtle
tawdry mirage
#

i'm lazy to manually setup list of objects(kids) inside monobehaviour based script(mother) in editor. Anyway, i put them(kids) as child transforms under their parent(mother) transform, just for visual clarity. Sooo, is it okay to just go through parent transform's child transforms and catch them to mother's list using GetComponent<> in a loop?

slender nymph
#

GetComponentsInChildren exists

tawdry mirage
#

i mean, is that a bad practise with hidden problems?

modest barn
#

Hi. I'm getting an ArgumentNullException error and this is the text that it gives me:

ArgumentNullException: Value cannot be null.
Parameter name: array
System.Array.IndexOf[T] (T[] array, T value) (at <834b2ded5dad441e8c7a4287897d63c7>:0)
Encoders.ShiftCaesarCipher (System.String plaintext, System.Int32 shuffle) (at Assets/Scripts/Encoders.cs:48)
DecodeButton.OnClick () (at Assets/Scripts/DecodeButton.cs:23)
UnityEngine.Events.InvokableCall.Invoke () (at <b1fe495152fd4f0180f79e56e3bccacc>:0)
UnityEngine.Events.UnityEvent.Invoke () (at <b1fe495152fd4f0180f79e56e3bccacc>:0)
UnityEngine.UI.Button.Press () (at ./Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Button.cs:70)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at ./Library/PackageCache/com.unity.ugui@1.0.0/Runtime/UI/Core/Button.cs:114)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at ./Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:57)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at ./Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/ExecuteEvents.cs:272)
UnityEngine.EventSystems.EventSystem:Update() (at ./Library/PackageCache/com.unity.ugui@1.0.0/Runtime/EventSystem/EventSystem.cs:530)

Being new to Unity, I have no idea how to figure this out. Where actually is the null array?

slender nymph
slender nymph
#

seems it is at Assets/Scripts/Encoders.cs:48

modest barn
slender nymph
#

one of the methods you have added to the button's event

modest barn
#

DecodeButton.cs

using System;
using TMPro;
using UnityEngine;

public class DecodeButton : MonoBehaviour
{
    [SerializeField] TMP_InputField plaintextInputField;
    [SerializeField] TMP_InputField shuffletextInputField;
    [SerializeField] TMP_Text outputTextBox;

    Encoders encoderScript;

    private void Start()
    {
        Debug.Log($"DecodeButton on {name}");
        encoderScript = new Encoders();
    }

    public void OnClick()
    {
        int shuffle;
        Int32.TryParse(shuffletextInputField.text, out shuffle);
        string output = encoderScript.ShiftCaesarCipher(plaintextInputField.text, shuffle);

        outputTextBox.text = output;
    }
}

I don't see what's null here?

slender nymph
modest barn
#

Oh my bad sorry let me go check that out

modest barn
# slender nymph because you aren't looking at the right place https://discord.com/channels/4892...

Encoders.cs

using System;
using UnityEngine;


public class Encoders : MonoBehaviour
{
    // Pre-defining the ordered alphabets and integers for ease of access in all functions that need it
    char[] upperAlphabet;
    char[] lowerAlphabet;
    int[] integers;

    // Start is called before the first frame update
    void Start()
    {
        // Fetch lists from ListConstants.cs to ensure that it is fully updated.
        upperAlphabet = ListConstants.upperAlphabet;
        lowerAlphabet = ListConstants.lowerAlphabet;
        integers = ListConstants.integers;
    }   

    public string ShiftCaesarCipher(string plaintext, int shuffle)
    {
        if (string.IsNullOrEmpty(plaintext))
        {
            return "";
        }

        string encodedStr = "";
        foreach(char ch in plaintext)
        {
            // Digits remain unchanged
            if(Char.IsDigit(ch))
            {
                encodedStr += ch;
                continue;
            }
            
            if(Char.IsUpper(ch))
            {
                // Takes the index of the char in the ENCODED string, adds that (also works with negative numbers) to the index, and adds the new char in the array to 'decodedStr'
                char newCh = upperAlphabet[(Array.IndexOf(upperAlphabet, ch) + shuffle)];
                encodedStr += newCh;
                continue;
            }
            
            if(Char.IsLower(ch))
            {
                char newCh = lowerAlphabet[(Array.IndexOf(lowerAlphabet, ch) + shuffle)];
                encodedStr += newCh;
                continue;
            }
            
            // If the character is not a digit or alphabetical character, add it without shuffling it.
            encodedStr += ch;
        }

        return encodedStr;
    }
}

There also shouldn't be anything null here...

slender nymph
#

long blocks of !code should be shared using a bin site.
you also need to point out which is line 48

eternal falconBOT
olive lintel
#

am I the only one encountering a bug where Input.GetMouseButton(0) is sometimes getting "stuck", as in, I will use LMB and then it will continue to act as if LMB is being held down... anyone know if this is a known bug? I keep on getting told to just use the new input system but it would require a lot of things to be re written

#

(and I used if(Input.GetMouseButton(0)){debug.log("here))}; to figure out what the issue was, turns out after using left click it would for some reason think I was holding LMB down even after I had released it completely)

#

idk hopefully its just a problem with my mouse but it really doesn't seem to be

#

issue only stops once I use LMB again

#

then it fixes itself

wintry quarry
olive lintel
#

and also I am not holding LMB in the clip once it keeps shooting

#

I'm just tapping LMB

#

and then boom

#

but then whenever I tab out

#

it stops

#

and then when I tab back in it starts again

verbal dome
olive lintel
#

so idk

regal bane
#

Hi,

I have a ball that moves with velocity, it laso has a sphere collider.
Next I have a player with a simple box collider IsTrigger enabled. And a rigidbody with isgravity disabled and iskinematic enabled

When they collide the force of the ball slows down. I don't get it, it should not have any impact when istrigger is enabled?

olive lintel
#

well

verbal dome
#

Good news is that you can use the old input system for everything else and new system for mouse input

olive lintel
#

thanks, just a bit annoying

verbal dome
#

Curious, what unity version are you on?

regal bane
#

Marc is that function in the update or fixedupdate?

verbal dome
#

I remember losing my mind with this bug

olive lintel