#💻┃code-beginner

1 messages · Page 8 of 1

short hazel
#

Configure your code editor to continue

#

It is required to get help here

jovial peak
tepid cove
#

yeah 100% ima get that done then, that will help me lots

tepid cove
ember musk
#

Is AssetDatabase.LoadAssetAtPath loads ScriptableObject? Why it fails in

PrefabsContainer prefabs = AssetDatabase.LoadAssetAtPath<PrefabsContainer>("Assets/Resources/PrefabsContainer.asset");
oblique gazelle
#

i can send you

minor raptor
#

hi

#

so i just started trying to code in unity so like

#

i am trying to make my camera follow an object

oblique gazelle
minor raptor
#

so like is there anything i can use to make the camera follow an object?

wintry quarry
oblique gazelle
#

here is my code

#

for inventrouy

#

guyz

minor raptor
cosmic dagger
eternal falconBOT
#
Posting code

📃 Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

wintry quarry
ember musk
minor raptor
#

by now i want to just use plain unity

minor raptor
#

hmm

#

i want to make a object that moves

#

and i want the camera to follow it

#

i dont want the object to be anchored into the camera or something

wintry quarry
charred spoke
#

Cinemachine is a official part of unity so it is plain unity. It is also all the camera code you will ever need

minor raptor
#

im not familiar with the api

oblique gazelle
#

guya please help em

charred spoke
#

So learn it and do t bother

minor raptor
#

i wanted to know if there is like some sort of class or anything to make a object point to another object

wintry quarry
eternal falconBOT
#

🧑‍🏫 Unity Learn can offer you over 750 hours of free live and on-demand learning content for all levels of experience! Make sure to check it out at https://learn.unity.com/

minor raptor
#

gaming

tepid cove
#

i did what the link you sent did and installed the stuff

#

but now my code is jsut blue

ember musk
# minor raptor and i want the camera to follow it

You can create an empty object called "CameraTarget" or something, and get its Transform. Then create a class CameraController derived from MonoBehaviour and attach it to your camera. In Update of CameraController, you can transform.position = cameraTarget.position

tepid cove
ember musk
#

of course you need to get Tranform of CameraTarget first in CameraController

minor raptor
#

cool

#

yes i probably should watch tutorials first xdd

ember musk
#

(and set CameraTarget as the child of your player)

short hazel
tepid cove
rotund gorge
#

hey

#

anyone there

late burrow
#

why each player has different results of raycast when they start from exact same spot for everybody
Physics.Raycast(allparticles[i].position, allparticles[i].velocity, out hit, allparticles[i].velocity.magnitude * Time.deltaTime, 1 << 0)

hard viper
#

does anyone know if unity editor 2019.4.31 is compatible with Windows 11?

late burrow
#

somebody else couldnt run it on windows 11

hard viper
#

ah so thats what it is then!

#

damn imma have to see if i can revert

main karma
#

@short hazel thank you so much, I solved the issue because of you,
I thought that if I had the struct in a Serializable class I don't need to serialize the stuct as well. The other huge mistake that I did was writing the wrong string in the save script (passed the "data" which was the class b4 converting it to JSON instead of dataToSave which a JSON string). It works fine now

hard viper
short hazel
tepid cove
hard viper
#

I'll check it and then move there

tepid cove
#

@short hazel i got it working

gusty gyro
#

i have a question, is it possible to have a unity 2d game thats multiplayer but player 1 and player 2 have own special movement like player 1 cannot move while player 2 can move?

short hazel
# tepid cove

Good. Not sure why you added this on line 27 though, you were meant to edit line 26 using my example

#

Or doing = Instantiate(bullet, spawnPoint.position, spawnPoint.rotation), you choose
You already have a part of it on line 26, add the missing stuff

tepid cove
hoary citrus
onyx prairie
#

Why are the enemys not waiting 1 to 3 second before they spawn? They are just spawning nonstop without any cooldown at all

dim radish
#

hey me and my friend are wanting to make a game like bit life using unity where have some hardship with getting the basic done like the aging system can any one help with that, i feel like i tried everything but we cant achive that bitlife aging and the years going up fase

hoary citrus
onyx prairie
wintry quarry
wintry quarry
hoary citrus
#

You can make a bool like "isCoolingDown" and set it to true before calling the coroutine and to false inside the coroutine at the end. And check if the bool is false before calling the coroutine

wintry quarry
#

Or just use a timer in update and ditch the coroutine entirely

onyx prairie
#

ty!

hoary citrus
#

When an object is destroyed all coroutines automatically stop?

short hazel
#

Coroutine stops

wintry quarry
queen adder
#

hewp

wintry quarry
queen adder
#
MainCharacterController.mainCharacter = MonoBehaviour.Instantiate(JsonUtility.FromJson<Creature>(value));
queen adder
wintry quarry
#

The whole thing

#

Is it a mono behavior?

queen adder
#

ye

wintry quarry
#

You won't be able to deserialize a mono behavior

#

They can only be created with Instantiate or in the editor

#

Or AddComponent

queen adder
#

🥹

wintry quarry
#

Move the data you want to serialize into a POCO.

queen adder
#

ig json won work on my save system 🥹

#

like forcefully changing the fields in the monobehaviour?

#

hopefully without reflection

#

are there life hax?

winged meadow
#

hi, i'm doing here a list of a list, but it don't show up in the inspector :/

queen adder
#

unity cant serialize list

#

of list

#

use a class that hold a list and make a list of that class instead

onyx prairie
#

what should i do, if i want my enemy prefab to move towards the player but can't get a reference to the player, because it's a prefab?

nocturne parcel
#

Are marker interfaces that terrible? They really seem to be useful for a situation I'm having to deal with.

short hazel
#

As in interfaces that don't force you to implement anything?

nocturne parcel
#

Yeah, empty interfaces

#

Just to group some classes

short hazel
#

What's "the situation" here?

young warren
short hazel
#

An abstract base class can also be an alternative

young warren
#

Then look at dependency injection @onyx prairie

nocturne parcel
#

I have two types of "super" tiles, water and land. I have two tiles inheriting from water: shallow water tile and ocean tile.
I need checks for both the water and land tile, and also checks for the tiles inheriting from water. It is also a form to make some sort of parameter for the types so that I can use in the Tilemap.GetTile<T> generic.

#

i.e tile = tilemap.GetTile<ICustomTile)
tile.MyOverrideFunction

#

Or whatever

#

Anyways

raw rain
#

Is there any way of turning yaw, roll and pitch into mouse axis while an object is moving? I've tried using tutorials but the system that functions on the WASD doesn't function as well on mouse axis.

rocky canyon
#

sure it does.. Input.GetAxis("Mouse X");

#

and Mouse Y

raw rain
#

I've used that but when it is applied, problems persist with the transform.rotate system.

#

Let's say if i do:
x = Input.GetAxis("Mouse X");
y = Input.GetAxis("Mouse Y");
transform.Rotate(x, x y);
transform.position += transforn.forward * speed * time.deltaTime;

#

the object will just go into a random spiral when i turn

ember musk
raw rain
#

so that should fix the pitch and yaw but how do I allow the roll to still work then?

ember musk
raw rain
#

sorry, i meant to say roll

ember musk
raw rain
#

oh

ember musk
#

Your can rotate around z-axis to roll

raw rain
#

ok

#

but how would i do that and prevent the plane from going into a doom spiral?

covert matrix
ember musk
raw rain
#

ok, thanks

languid spire
#

why are you using GetKey?

#

can you post your code correctly please
!code

eternal falconBOT
#
Posting code

📃 Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

safe radish
#
private void AlignGodRaysWithLight()
    {
        float lightRotationY = directionalLight.transform.rotation.eulerAngles.y;

        ParticleSystem.MainModule mainModule = godRays.main;
        mainModule.startRotationY = lightRotationY;
    }``` im trying to align my godrays with my lightsource, the code is working but the angle is not even close to being correct
distant current
#

how to keep the player's position at the center of the tilemap when moving diagonally?

tawdry rock
#

Hi. Im making a stamina bar.. if the player hold shift and is grounder and other conditions are met.... stamina decreases. Good, I made a slider that give feedback to player how much stam he has. Now sliders use floats as value as far as i know between 0-1.
I dont want the player to see 85.45344% i just simply want to 85% displayed so i made another variable called staminaFloor so i can use that to floor down and display that value as feedback: staminaText.text = staminaFloor.ToString() + "%";
Im passing stamina's value to staminaFloor to do a accurate flooring but when i want to update the slider decreasing and say: staminaSlider.value = stamina / 100; i have a error that stamina cannot be a double... but i cannot do flooring on floats. So any idea how to convert floats to double or vica versa?

languid spire
#

why is stamina a double in the first place?

tawdry rock
short hazel
#

You don't need another variable btw, you can just pass a format string that says "display no decimals"

#

.ToString("F0")

languid spire
#

well if that is true
then turn stamina back to a float
then you can Floor(double)stamina)

short hazel
#

Or actually here, "P0" and it'll display the percent sign for you depending on the user's language!

#

(some languages put the % sign before, or after the value with no space)

safe radish
#

ah i just noticed that if i change the X rotation of my lights the rays change aswell

tawdry rock
#

Here is the code for my OP. I will try .ToString("F0")

keen dew
#

and (int)floatVariable

tawdry rock
#

Mathf is for float math?

slender nymph
#

yes, unity has its own Mathf class specifically to work with floats since c# didn't get a MathF class until much later

summer stump
tawdry rock
#

Okay, i can confirm everything wokring with mathf... i think very long time ago i saw a javascript video and there Math.Floor was used thats why it stick to me. But its good to know Mathf exist. i prefer floats over doubles so...

short hazel
#

Actually just tested, the P formatter actually expects a number between 0 and 1 for a regular percentage, so just use F

#

Plus it's easy if you want to display a decimal, it's just F1, change the number to display more or less

#

((4.25f).ToString("P0") -> 425%)

tawdry rock
short hazel
#

Then you can use P0

#

And avoid flooring/truncating altogether

keen dew
#

P0 does rounding instead of flooring though

tawdry rock
#

The point is, its working now and if it not broken ain't fix it! I will keep this P0 and F0 in my head tho. It's good to have a community like this where i can get quick answeres 🙂

uncut shoal
#
    {
        if (size.x > point.x && size.y > point.y)
        {
            if (pixels.GetLength(0) > point.x && pixels.GetLength(1) > point.y)
            {
                var pixel = pixels[point.x, point.y];
                if (!pixel.destroyed || pixel.color.a != 0) return true;
            }
        }
        return false;
    }``` why does this keep telling me the index of `var pixel  = pixels[point.x, point.y];` is out of bounds even with all the restrictions???
short hazel
#

The conditions are not perfect, they should be >=

#

Or, better reversed point.x < pixels.GetLength(0)

uncut shoal
#

why would there be a difference if its reversed

short hazel
#

Because the inverse of < is >=

#

And it's more legible that way

uncut shoal
#

still says that

short hazel
#

"if my value is less than the length" is more comprehensible than "if the range is greater than my value"

uncut shoal
#
    {
        if (size.x > point.x && size.y > point.y)
        {
            if (point.x < pixels.GetLength(0) && point.y < pixels.GetLength(1))
            {
                var pixel = pixels[point.x, point.y];
                if (!pixel.destroyed || pixel.color.a != 0) return true;
            }
        }
        return false;
    }```
short hazel
#

2 possibilities, the value is less than 0, or the array is empty

#

You should be logging that vector to see what it contains

uncut shoal
#

the array shouldn't be empty since I initialize the thing

#

which fills it with the pixels

short hazel
#

Prove it with logs

uncut shoal
#

ok

#

o yea these values are a little wrong?

#

arrays can't be less than 0 right?

short hazel
#

There you go

#

You're passing negative values to the array's indexer

#

That's illegal

uncut shoal
#

this is weird

#

it shouldn't be negative

#

I'll try to log it before I turn it from a local position to a pixel position

#

I'm trying to make my per-pixel destruction work with joints

gaunt ice
#

size probably a non-negative vector2int
so if one of the components of point is negative it always <size.corresponding component

unreal imp
#

ok, remember when I try to make a weak point of an object? (if it receives a single shot the object is destroyed) well now I adapted it to this script but it doesn't work for me.
It is to try to script the parent object to explode if (hit.transform.gameObject.CompareTag("WeakPoint")) { var v = hit.transform.gameObject.GetComponentInParent<ToiletExplodes>(); v.hitsReceived = v.maximalHitsToDestroy; }^ all of it on the update method

uncut shoal
#

my per-pixel destruction works fairly well but it doesn't work with joints at all

dusky vector
#

For my project, I am trying to make my player automatically jump when they touch an object that is part of a certain layer, the problem is I believe I am referencing it wrong. Here is the code.
https://paste.ofcode.org/b4H6VTTpQeTFU6caRZsMgB

uncut shoal
#
            {
                var anchor = pd.LocalToPixel(pd.transform.InverseTransformPoint(transform.TransformPoint(j.anchor)));
                if (pd.IsTherePixel(anchor))
                {
                    var joint = pd.gameObject.AddComponent<HingeJoint2D>();
                    Stuff.CopyHingeJoint(j, joint);
                }
            }```
#

is there a way to handle this better

#

first I move the anchor to world space, then I move the anchor to the local space of the new part, and then I move the anchor to the pixel space of the new part.

#

it works if its on the right side of the thing aka the positive side

safe radish
#
private void AlignGodRaysWithLight()
    {        
        float lightRotationYRad = directionalLight.transform.rotation.eulerAngles.y * Mathf.Deg2Rad;
        float lightRotationXRad = directionalLight.transform.rotation.eulerAngles.x * Mathf.Deg2Rad;
        
        ParticleSystem.MainModule mainModule = godRays.main;
        mainModule.startRotationY = new ParticleSystem.MinMaxCurve(lightRotationYRad, lightRotationYRad);
        mainModule.startRotationX = new ParticleSystem.MinMaxCurve(lightRotationXRad, lightRotationXRad);        
    }``` i tried this but the angles still dont match
hidden citrus
#

hey, how do you change a mesh filter's mesh? it doesn't seem to be as simple as object.mesh = gameObject

#

I think this might be it

    public void ChangeModel(GameObject item)
    {
        currentModel.mesh = item.GetComponent<MeshFilter>().mesh;
    }
oblique gazelle
#

could anyone please help me ?

swift crag
#

Ask your question.

oblique gazelle
#

need help to shoot right with my player

#

could anyone help me ?

#

my weapon is right now rotate

#

i can show you

#

this is what I have

#

the pistol is not ready to shoot forward

swift crag
#

then rotate it so that it's pointing forward..?

hidden citrus
#

what's the proper code for "destroy instance if more than once instance exists in a scene"? is it some kind of count? onEnable count++ to keep track of how many are active then destroying a select instance?
This seems to destroy every single one, and I don't want to place it into "do not destroy" in this case. just locally clean out any duplicates

    private void OnEnable()
    {
        if (Instance != null)
            Destroy(gameObject);
    }
eternal needle
oblique gazelle
swift crag
hidden citrus
#

i have this item previewer that pops up, and its bugging out for some reason, so i want to destroy the previous instance and instantiate the new one. It would be onEnable instead of awake

oblique gazelle
#

The gun is not my shoot diretcion

swift crag
#

That's the usual way to do it.

#

So the hierarchy will be something like

Upper Arm -> Lower Arm -> Hand -> Gun Holder

#

Attach the gun to Gun Holder, then rotate it until it looks right

oblique gazelle
#

Yes I put my gun there

#

in guContianer

swift crag
#

then exit play mode and set the same rotation

oblique gazelle
tepid cove
#

i have this code and my MAIN point is the fire rate, right now oyu can spam fire the gun where i want to make it so you can only fire the gun every 0.5 seconds no matter if you spam the trigger. yet the code i wrote set to "0.5" does nothing you can still spam, what did i do wrong?

swift crag
#

your if statement is not doing what you think it does

#

An if statement applies to the next statement

oblique gazelle
swift crag
#

Oh, one other thing

tepid cove
swift crag
#

After you parent the gun, set its transform's localRotation to Quaternion.identity

#

That will zero out the local rotation

oblique gazelle
swift crag
#

That may be the problem.

oblique gazelle
#

is the position of the mousecursor

#

where I whould shoot

#

?!

swift crag
#

so yeah, block statement

oblique gazelle
hidden citrus
#

maybe a check for "does this item exist in the scene -> destroy it" then running the cached instantiate?

oblique gazelle
#

bro

#

pls help

hidden citrus
#

Like adding it to a private list to keep track on instantiate, then run a destroy + clear to force its destruction/debug

oblique gazelle
#

pls help me aim right with guns

tepid cove
oblique gazelle
swift crag
#

Don't spam.

swift crag
#
if (foo)
{
  One();
  Two();
  Three();
}
tepid cove
tepid cove
#

:>

swift crag
#

This also applies for things like for loops

#

You can also just use them whenever you want

oblique gazelle
#

Guyz I have a question

swift crag
#
{
  int x = 3;
}
x = 4; // error, x is gone
oblique gazelle
#

how do I use script for each weapon?
it should be different functionallies

#

For example:
a sniper needs to have a scope while ak does not

short hazel
#

Make two different scripts

oblique gazelle
#

yes

#

but how do I enable them script when using the waepon

short hazel
#

They should be on the weapon to start with

oblique gazelle
#

you mean I should not add compnents ?

short hazel
#

A weapon prefab you Instantiate(), and this way it'll enable the script when the object is in the scene

oblique gazelle
#

when pickup

#

wait

#

so I use instatiate?

#

I will show oyu

short hazel
#

What I do is use one prefab for the pickup (has only the visual and a pickup detection script), and another for the real weapon

oblique gazelle
#

Here is my pickup function right now

short hazel
#

Oh lord

oblique gazelle
#

Im using switch to add weapon component for each different script

cosmic dagger
eternal falconBOT
#
Posting code

📃 Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

oblique gazelle
#

what

short hazel
#

Yeah no definitely use prefabs for this

oblique gazelle
#

what

eternal needle
short hazel
#

Don't do it all from the code. It's very ugly and repeated and error-prone

cosmic dagger
oblique gazelle
#

ok

#

so I should not enable the script?

#

on pickup

#

or what

short hazel
#

If the pickup is the weapon with the shooting script disabled, then yes you need to enable it on pickup

hidden citrus
# eternal needle im not sure what you mean by "instantiation stacking". You could do a FindObject...

Yea, so i used a for loop + list to force destroy the cached instances. I was var cached = Instantiate(thing); and it would keep creating prefabs.
But by adding it to a list cacheList.Add(cached) I could run a destroy Destroy(cached[i]) in the for loop 1 step before starting the instantiation (if cachedList.Count > 0 then Destroy)

The problem was that it kept spamming instantiations and those spawned items had no way of self deleting or seeing other instances of the same thing (same class shared across all instantiations, they all were Instance in awake). But the list + delete method works and now it only spawns 1

short hazel
tepid cove
swift crag
#

Right, but now you'll want to move the rest of that logic into the block as well

#

Right now, the block statement only contains one line: nextFire = Time.time + fireRate;

#

The rest of your code is running unconditionally.

eternal needle
oblique gazelle
#

could anyone show me code or video for weapon system

#

to shooting with differnt weapons

short hazel
#

Seeing your past questions, sound like you need to !learn the basics

eternal falconBOT
#

🧑‍🏫 Unity Learn can offer you over 750 hours of free live and on-demand learning content for all levels of experience! Make sure to check it out at https://learn.unity.com/

short hazel
#

No one is going to make you some code for free

oblique gazelle
#

ok but

#

I will pay

#

someone

short hazel
#

Then paid requests are not to be made here, they should be on the Forums

#

!collab

eternal falconBOT
oblique gazelle
#

how to make a simbple inventory unity

#

??

swift crag
#

you are going to get nowhere if you just ask vague questions without putting in any real effort

short hazel
#

They've been doing this for a few days straight lol

#

Maybe once they see it gets nowhere, they'll stop and ask more elaborate questions

oblique gazelle
#

could someone help me with innvenyoruy

short hazel
#

<@&502884371011731486> spam

tepid cove
swift crag
#

uh oh!

short hazel
#

Yeah they've been warned before, seems like they can't behave properly

lofty urchin
#

oh hm

rich adder
#

dude legit has like no people xp

safe radish
#
private void AlignGodRaysWithLight()
    {    
       lightRotationY = directionalLight.transform.rotation.eulerAngles.y;
       lightRotationX = directionalLight.transform.rotation.eulerAngles.x;

        var main = godRays.main;

        main.startRotationY = lightRotationY * Mathf.Deg2Rad;
        main.startRotationX = lightRotationX * Mathf.Deg2Rad;
       
        Debug.Log("Light Rotation (Y): " + lightRotationY);
        Debug.Log("Light Rotation (X): " + lightRotationX);
    }```   how do i correctly convert the angles of my light to the radiants the startrotation needs?
swift crag
#

are you aiming a particle system here?

queen adder
#
namespace UnityEditor.Extension
{
  public class X
  {
    ...
  }
}

If extend a class to the UnityEditor.Extension like the above example, will it only work for editor or do i need to wrap with symbols?

swift crag
#

I don't think the namespace affects anything.

#

Putting it in an Editor folder would prevent it from being included in the built game, though.

safe radish
queen adder
#

This class will be used in runtime as a component (like a information class that is serializable) this is why i did that 😦

swift crag
safe radish
#

the code works and im changing the values. but cant get the correct angle

swift crag
#

i'm not very familiar with getting specific rotations from particle systems

#

perhaps they're in the wrong space?

#

i.e. those rotations are relative to the particle system's transform

queen adder
#

I needed to show some information about a runtime class and i wrap these informations into a serializable class that way i could be a little organized.
We cannot dragNdrop a component from editor folder and we cannot use a class that is from editor folder inside a runtime class. That is why i did that...

#

I could have done a simple EditorGUI script

swift crag
#

I still do not understand. If this is not supposed to be an editor-only script, then don't make it editor-only. That's all.

#

Am I missing something here?

safe radish
queen adder
#

Maybe you are right i shouldn't have done this

#

Hey guys I have a question, I had a problem with remote configuration, so I asked for help in "unity gaming services", sadly nobody has answered because usually almost nobody looks at that channel.
Is it ok if I ask the same question in a channel where there are more people?
I'm talking about asking the question in a programming channel and not in the UGM.

safe radish
queen adder
hidden citrus
#

is anyone well versed in diagonal rotation? Like Quaternion.LookRotation(transform.forward + -transform.right, Vector3.up) where you look at that specific direction when two keys are pressed? I'm having difficulty registering that data as the look at point/direction

eternal needle
swift crag
eternal needle
#

Oh they already use it

queen adder
swift crag
#

I wonder if the particles need to have a rotation offset

#

Try setting the start rotation to all zeroes and seeing what you get

#

Does it line up with the direction that the light source is at with an all-zero rotation?

safe radish
safe radish
# swift crag was it correct?

i tried my own values there aswell as set them all to 0, but they just get overwritten by the script ( as should happen)

swift crag
#

well, turn it off, then

#

a rotation of zero should be easiest place to start

limpid dawn
#

? How can I make a script that rotates the camera (Right and left ) in the direction the player moves in ?

hazy ivy
#

hello, i would like to ask if there is a script that can bake, or apply transform to a gameobject

#

i did that in blender but for some reason the values changed in unity

queen adder
# swift crag Am I missing something here?

I would like to get your idea on this.
I have 2 class that belongs to a base interface. Lets say its ClassA : BaseInterface and ClassB : BaseInterface
I created a PropertyDrawer for the BaseInterface so that way i will need only one property drawer that handles everything.
This two classes will have same editor-only fields that will be informations about that class.
Ex: its name, age etc... But it is not defined in every class so i just learned some editor tricks to manage the null references so it wont show if it does not defined.
The information will be editor only. It wont be used in Runtime. Information can be made from 3-4 or more fields which means i need to write to every class since i cant use abstraction it breaks the dependency of eachother.
So i thought about creating an editor-only class that will be information for these classes.
Should i go without an editor-only class? Sorry if its too dumb sadok

eternal needle
hazy ivy
#

sorry lemme explain a bit more:
the gameobject is a bone, which the scale is 1,1,1 in blender
after i did some parenting of the bone to another armature in unity, the scale became 0.01,0.01,0.01, while the parent bone is 1,1,1
as the mesh is skinned, changing the values deformed the meshes as well.
i want to head bone to become scale 1,1,1 while keeping the mesh intact, similar to blender's apply pose to rest pose

safe radish
#

ive set both the x and y of my lights to 130, i did some testing and need about a radiant of 50 for both x and y to get the correct angle, but my formula with the euler angles outputs 50 and 310 for the y? @swift crag

swift crag
#

50 radians is a ton of turns

#

remember that 2*pi radians are a full circle

safe radish
#

then are the docs not correct? if i input lower numbers there they basically dont move

swift crag
#

the UI shows you the values in degrees, for sure.

eternal needle
#

this is more of a model issue than unity/code

swift crag
#

try switching this to "FBX All". I am very fuzzy on how these different scaling modes work, but that's the one I default to

#

and it results in armatures with a 1,1,1 scale

hazy ivy
#

now that you mentioned it yea i think i forgot to apply transform for the root empty 😭

#

only did to the armature and mesh

#

strange that it did not affect other bones however

main karma
#

ok so blender is totally my field, that being said animations are not, but these are my blender export settings for unity if it helps with anything

#

make sure to select all the objects you want to export

#

and you can save the settings as a preset for future use if it works well

queen adder
#

I want to instantiate a prefab for a little sphere entity that changes size. What's the best way to pass a value to a prefab you're instantiating with code? I just want to pass a single float.

#

I think I can do GetComponent<Orb>().SetRateOfChange(5) or something,

#

but that seems a bit inefficent

main karma
#

uh you could create a constructor for the class that takes a float as a parameter I think

keen dew
#

If the prefab field is of type Orb then you don't need the GetComponent. And you don't need a setter method if the variable is public. Otherwise that's the way to do it.

queen adder
#

real!

keen dew
#

MonoBehaviours can't have constructors

queen adder
#

yeah I tried constructors

#

did not work

main karma
hazy ivy
cinder goblet
#

Hello everyone, i need help to make portals in URP. I tried to follow first Sebastian Lague's tutorial but i don't know how convert Portal camera rendering things from built-in to URP, so suddenly i followed Daniel Ilett's tutorial but i don't know how convert RenderSingleCamera method now that it's deprecated.

keen dew
safe radish
#

@swift cragi think i found the issue, i've fixed the y axis by adding a * -1 when i noticed that was inverted. problem now is that the x is inverted aswell and adding a * -1 there flips the y again 🤨

main karma
#

that being said

#

I still can't do portal recursion

safe radish
#
private void AlignGodRaysWithLight()
    {
        lightRotationY = directionalLight.transform.rotation.eulerAngles.y;
        lightRotationX = directionalLight.transform.rotation.eulerAngles.x;

        var main = godRays.main;

        main.startRotationY = lightRotationY * Mathf.Deg2Rad *-1;
        main.startRotationX = lightRotationX * Mathf.Deg2Rad;  // adding *-1 here flips the y again

        Debug.Log("Light Rotation (Y): " + lightRotationY);
        Debug.Log("Light Rotation (X): " + lightRotationX);
    }```
queen adder
#

quick question,

#

how can I both import this circle with proper transparency, and make it into a particle that always faces the camera?

slender nymph
#

this is a code channel

queen adder
#

Yeahg

#

this would require code no?

swift crag
#

no, you are asking about importing assets and setting up a particle system

#

neither of these involve any code

inland parrot
#

can i code something to fix unity rn?

hushed hinge
#

what does this mean?

swift crag
slender nymph
#

looks like an editor error, if you aren't writing editor code you can clear the console

hushed hinge
#

I can clear the error when I click on Clear, so there's nothing to worry about?

slender nymph
#

you can usually just ignore most editor errors if they have something to do with GUIUtility

summer stump
crisp token
#

anyone know why this line is giving me an error?

#

Assets\Scripts\Weapons\Melee Combat.cs(103,65): error CS0119: 'Camera' is a type, which is not valid in the given context

eternal falconBOT
#
💡 IDE Configuration

If your IDE is not autocompleting code
or underlining errors, please configure it:

Visual Studio (Installed via Unity Hub)
Visual Studio (Installed manually)

VS Code*
JetBrains Rider
Other/None

*VS Code's debugger plugin is unsupported.
We recommend using VS or Rider instead.

river roost
#

you should be getting a red underline

crisp token
#

Ik i just tried to configure it but it didn't work

#

should I be using visual studio instead of visual studio code?

short hazel
#

VSCode support changed, you need to install different packages

#

Redo the configuration guide to be up to date

crisp token
#

ok

#

ty

queen adder
#

Why is the terrain not setting the neighbors properly for the LODs, i don't know if there is something wrong in the code

  foreach(KeyValuePair<string, GameObject> ChunkDictionary in Chunks)
        {
            string[] ChunkID = ChunkDictionary.Key.Split(",");
            int ChunkX = int.Parse(ChunkID[0]);
            int ChunkY = int.Parse(ChunkID[1]);

            string TopKey = (ChunkX) + "," + (ChunkY + 1);
            string RightKey = (ChunkX + 1) + "," + (ChunkY);
            string LeftKey = (ChunkX - 1) + "," + (ChunkY + 1);
            string BottomKey = (ChunkX) + "," + (ChunkY - 1);

            GameObject ChunkTop = null;
            GameObject ChunkRight = null;
            GameObject ChunkLeft = null;
            GameObject ChunkBottom = null;

            Terrain ChunkTopTerrain = null;
            Terrain ChunkRightTerrain = null;
            Terrain ChunkLeftTerrain = null;
            Terrain ChunkBottomTerrain = null;

            Chunks.TryGetValue(TopKey, out ChunkTop);
            Chunks.TryGetValue(RightKey, out ChunkRight);
            Chunks.TryGetValue(LeftKey, out ChunkLeft);
            Chunks.TryGetValue(BottomKey, out ChunkBottom);

            if (ChunkTop != null)
            {
                ChunkTopTerrain = ChunkTop.GetComponent<Terrain>();
            }
            if (ChunkRight != null)
            {
                ChunkRightTerrain = ChunkRight.GetComponent<Terrain>();
            }
            if (ChunkLeft != null)
            {
                ChunkLeftTerrain = ChunkLeft.GetComponent<Terrain>();
            }
            if (ChunkBottom != null)
            {
                ChunkBottomTerrain = ChunkBottom.GetComponent<Terrain>();
            }
            GameObject Chunk = ChunkDictionary.Value;
            Terrain terrain = Chunk.GetComponent<Terrain>();
            terrain.SetNeighbors(ChunkLeftTerrain, ChunkTopTerrain, ChunkRightTerrain, ChunkBottomTerrain);
            terrain.Flush();
        }
swift patio
#

jetbrains rider dll error???

river roost
#

gg

tender stag
river roost
tender stag
#

like HandleAppetite?

#

i think thats a good name

river roost
#

That's a terrible name

tender stag
#

why

river roost
#

sounds like a method

tender stag
#

oh a class

#

i thought u said a shared method

#

for both

short hazel
#

Shared method can also work

#

HandleVitals() maybe

river roost
#

It doesn't remove as much repetition

#

and you're going to end up with a function signature like HandleVitals(ref float current, float max, Slider slider, Vector2 interval, ref float timer)

analog depot
#

hi everyone - so a normalized vector will haul a vector back to magnitude one, but if the vector is LESS than one, it doesn't seem to push it up to one

#

is there something that will take a vector and always set its magnitude to 1?

#

vector3

short hazel
#

It does

#

The only edge case where it does not set the magnitude to 1, is if you normalize a zero-vector like Vector3.zero

#

Try, Debug.Log(new Vector3(0.2f, 0.2f).normalized) and you'll see it returns something like (0.707, 0.707, 0) which is a normalized vector

river roost
#

Not a code question, but why do you want to do that? You can edit a lot of stuff throught the import settings

analog depot
#

thanks @short hazel i've solved my issue, i only wanted x and z affected, if it zap y before normalizing then I do get the vector i want

crisp token
#

I've been having issues with the second raycast, anyone know (from what I'm showing) if I'm doing something improper?

ivory bobcat
#

Maybe tell us the issue

crisp token
#

not detecting even when I stand right in front and click on an object in the otherPlayer's layermask

ivory bobcat
#

The first and the second should do the same thing

#

Or rather have the same result

crisp token
#

Yeah so the second one is gonna be on a different layermask, but I was having issues so I changed the layermask as part of the debugging process. Right now, I was testing the coesmeticAttackResult raycasthit variable

#

they both works when i punch other players (who are marked in the otherPlayer layer), they do not work when I hit a cube marked in the same layer

ivory bobcat
#

If the only difference is a change in layer, make sure the layer is correct. Log the layer etc

#

You're probably better off showing the actual code that isn't working, the inspector setup, hierarchy, logs etc

knotty gull
#

this is my code for my weapon to aim where my mouse hit the ground, keep in mind the weapon is a child of the player
i want to make it so that it only changes the X rotation value, leaving the y,z of same previous rotation, how can i do that?

ivory bobcat
#

Maybe modify the direction vector to have the same y and z values as your forward direction

knotty gull
#

weapon have default 0,90,90 rotation, x is what tilte it left and right (top down 3d game)

ivory bobcat
knotty gull
#

what you suggested

short hazel
#

Either flatten the vector by setting Y and Z to 0, then by assigning to .localRotation
Or flatten the vector by projecting it using Vector3.ProjectOnPlane(dir, transform.up) so it's flat towards where you're looking, and assign to .rotation like you're doing

hushed hinge
#

I talked with Chatgbt and talked with it about some fixes it need to do, what you all all think of the falling platform, is there something it need to be fixed or adjusted?

river roost
hushed hinge
#

Sometimes they don't fall or respawn too fast?, that sentence got me confused

river roost
#

looks like there are some bugs

#

like when you jump up again, the first 3 don't fall after you step on them

hushed hinge
river roost
#

9 seconds into the video

cold olive
#
using System.Collections.Generic;
using UnityEngine;

public class PlayerMove : MonoBehaviour
{
    public float moveSpeed;

    public float jumpForce;
    public float gravityScale;
    public float maxFallSpeed;
    public bool candash = false;
    public bool isGrounded=false;
    public CharacterController controller;

    private Vector3 moveDirection;
    void Start()
    {
        controller = GetComponent<CharacterController>();
    }

    void Update()
    {
        isGrounded = controller.isGrounded;
        if (controller.isGrounded)
        {
            
        }
        //moveDirection = new Vector3(Input.GetAxis("Horizontal") * moveSpeed, moveDirection.y, Input.GetAxis("Vertical") * moveSpeed);
        float ystore = moveDirection.y;
        moveDirection = (transform.forward * Input.GetAxisRaw("Vertical") * moveSpeed) + (transform.right * Input.GetAxisRaw("Horizontal") * moveSpeed);
        moveDirection = moveDirection.normalized * moveSpeed;
        moveDirection.y = ystore;
        if (controller.isGrounded)
        {
            moveDirection.y = 0;
            if (Input.GetButtonDown("Jump"))
            {
                moveDirection.y = jumpForce;
            }
        }
        else
        {
            if(moveDirection.y>-maxFallSpeed)
            { 
                moveDirection.y -= gravityScale; 
            }
            
        }
        controller.Move(moveDirection * Time.deltaTime);
    }
}

im making a 3d movement engine, and for some reason the isGrounded boolean on the character controller keeps flashing on and off, despite the y value never changing

hushed hinge
river roost
#

but you should probably fix it

hushed hinge
#

ok

cold olive
#

i changed moveDirection.y = 0; to moveDirection.y = -1;

crisp token
#

Could someone explain how the collision effect matrix effects raycasts?

#

does a raycast belong to the layer it hits?

gritty atlas
#

You determine the layers you raycast on

#

If you don't determine any, it will probably hit everything

crisp token
#

well that would be the layermask, but I was wondering more the impact the collision matrix has on the raycast

muted wadi
#

can a transform's position not be set to something else if it is moving while being set?

summer stump
muted wadi
#

weird

summer stump
# muted wadi weird

Setting transform is just teleporting an object essentially. Whether it is small segements or large

muted wadi
#
{
    if (other.gameObject.tag == "Player")
    {   
        rangeCollider.enabled = false;
        playerT.transform.position = playerBC.transform.position;
        enemyT.transform.position = enemyBC.transform.position;
        Debug.Log("Enemy Triggered");
    }
}```this is what I have right now but its not teleporting the player as it does the enemy
crisp token
crisp token
#

Ok, thank you

summer stump
# crisp token Ok, thank you

Other than the IgnoreRaycast layer maybe, but I've never used it. So I dunno if that is just for a user to implement haha

summer stump
muted wadi
#

yeah, the enemy is meant to be teleported at the same time as the player

#

im wondering if its because of my movement script

summer stump
muted wadi
#

yeah p much

#

im just using someone else's movement script because im just experimenting with stuff and i dont wanna write my own one right now

#

so im just wondering if its interfering somehow

summer stump
muted wadi
#

playerBC is just a transform that holds the coords of where the player is to be teleported to

#

playerT is the player's transform

summer stump
#

No yeah, I got that. Those are the most likely things they could have been. Still log their positions

muted wadi
#

👍

#

playerT doesn't move on trigger

#

neither does playerBC

#

im gonna try something

#

ahh i knew it

#

right before i teleported the player I disabled the movement script

#

it seems the character controller overrides a teleport, maybe because even though your coords have changed, the character controller was moving you towards a different coordinate and the teleport gets overriden

grand cosmos
#

What fundamentals should I learn in C# before hopping into unity

#

I have never used C# before though i have used GDScript and python before a bit

queen adder
#

idk why put when i type i code it doesnt work as the tut said

north kiln
queen adder
#

i dont get it?

proud nexus
#

please help me, I am using LootLocker SDK

#

OH MY FUCKING GOD THE TIMESCALE WAS STILL )

#

0

#

IM FUCKING RETARDED

#

that was like 30 minutes of my game jam

#

cvxc,m

summer stump
# queen adder i dont get it?

Just to clarify what Vertx meant, and I say this to be helpful:

No one can help with the tiny amount of information you provided, you need to provide more for anyone to be able to help you. You can include code, or a more thorough description. What you said is so vague it is nearly meaningless. The code you're talking about could be ANYTHING, and any of those things could have dozens of reasons it doesn't work. It is impossible to even start to respond

This channel can help you know what to include in a question. At the top is the section for asking
https://discord.com/channels/489222168727519232/854851968446365696

alpine flicker
#

Hey i having a problem with making the score system and reset game for tron

summer stump
north kiln
#

!code

eternal falconBOT
#
Posting code

📃 Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

alpine flicker
#

So i was trying make a score system where everytime they collider to the wall or collider to the player wall, the game would give the user the score and would reset the player back to it position but it not working right i tried looking up links but i can't find any of it.

acoustic arch
#

my public tmpro wont let me actually put it there

#

did i declare the wrong namespace in the beginning?

#

lines 1, 24, and 60

ashen ferry
#

its TextMeshProUGUI

acoustic arch
#

thats what i thought

#

it should be like

queen adder
#

anyone free to help?

next oar
#

I'm working on a 2D project and my randomly wandering AIs keep going through the walls in spite of the colliders. any ideas what might be going on there and how to fix it?

summer stump
queen adder
#

!cs

eternal falconBOT
#

You can format your multiline code block with C# highlighting! Just add cs to the start of it. Highlighting example below!

class Fluffs : FluffyCat
{
    public void PetCat ()
    {
        Debug.Log ("Petting Cat.")
    }
}
queen adder
#

!cs error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement

eternal falconBOT
#

You can format your multiline code block with C# highlighting! Just add cs to the start of it. Highlighting example below!

class Fluffs : FluffyCat
{
    public void PetCat ()
    {
        Debug.Log ("Petting Cat.")
    }
}
queen adder
#

!learn

eternal falconBOT
#

🧑‍🏫 Unity Learn can offer you over 750 hours of free live and on-demand learning content for all levels of experience! Make sure to check it out at https://learn.unity.com/

summer stump
spring rain
#

Hi, I have CollectableChoice.cs and ManageMaterials.cs:


namespace HyperCasualRunner
{

    public class CollectableChoice : MonoBehaviour
    {
        private void Start()
        {
            TestNameSpace.ManageMaterials.GetInstance();
        }
    }
}```
and
```using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using NaughtyAttributes;


namespace TestNameSpace
{
    public class ManageMaterials : MonoBehaviour
    {
        public Material TransparentGreen;
        public Material TransparentRed;

        static ManageMaterials instance;
        public static ManageMaterials GetInstance()
        {
            return instance;
        }
        private void Awake()
        {
            instance = this;            
        }
    }
}```
My error is that TestNameSpace and ManageMaterials  can't be found, therefor the line "TestNameSpace.ManageMaterials.GetInstance();" in CollectableChoice.cs throws and error.
north kiln
queen adder
north kiln
queen adder
#

how can i do that?

north kiln
summer stump
#

The tutorial did NOT put them there

queen adder
#

i am following a brackyes tut

north kiln
#

Also, if your IDE is not underlining errors and giving proper autocomplete you need to configure it

eternal falconBOT
#
💡 IDE Configuration

If your IDE is not autocompleting code
or underlining errors, please configure it:

Visual Studio (Installed via Unity Hub)
Visual Studio (Installed manually)

VS Code*
JetBrains Rider
Other/None

*VS Code's debugger plugin is unsupported.
We recommend using VS or Rider instead.

summer stump
#

Remove the semicolons

queen adder
summer stump
#

Also, brackey is infamous for bad habits like adding deltaTime to mouse input

summer stump
north kiln
summer stump
#

Not ALL semicolons

#

Just the ones in the middle lol

eternal falconBOT
#
💡 IDE Configuration

If your IDE is not autocompleting code
or underlining errors, please configure it:

Visual Studio (Installed via Unity Hub)
Visual Studio (Installed manually)

VS Code*
JetBrains Rider
Other/None

*VS Code's debugger plugin is unsupported.
We recommend using VS or Rider instead.

queen adder
#

which semiclonse

summer stump
queen adder
#

oke

north kiln
#

You need to configure your IDE. Then you need to compare with the tutorial you have that will work.

queen adder
#

ok

#

ty no errors ❤️

north kiln
#

You still need to configure your IDE before doing any more programming

queen adder
#

ok

#

how should i doi it?

calm coral
summer stump
calm coral
north kiln
#

Namespaces are a good practice in any coding scenario

#

I have no idea what the issue is, the code looks fine

abstract pelican
#

Who will tell you a video on movement a character in 3d isometric using a new input controller?

calm coral
#

Maybe they're using assembly definitions incorrectly?

spring rain
summer stump
ashen ferry
#

why one bro has random symbol generator as their name and another speaks in puzzles

abstract pelican
spring rain
queen adder
#

i finished the ide tut

summer stump
north kiln
abstract pelican
summer stump
spring rain
north kiln
#

And in HyperCasualRunner or HyperCasualRunner\Scripts is there an Assembly Definition file?

spring rain
north kiln
#

Then that's your issue

#

Your scripts are in different assemblies

calm coral
north kiln
#

and one assembly isn't referencing the other

summer stump
# abstract pelican isometric?

As I said, don't be specific. It is irrelevant whether it is isometric or not. You are just capturing inputs. Learn new input first, then learn how to process ANY input in an isometric game. Processing the input will be the same in the new and old system.

final star
#

does anyone have a youtube tutoral or something to help me get started with game develpment and just get the basics down

spring rain
summer stump
north kiln
spring rain
queen adder
summer stump
eternal falconBOT
#
Posting code

📃 Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

jovial peak
#

anyone have a good guide on rendering 3d object in ui? like an inventory of items?

calm coral
wintry quarry
summer stump
wintry quarry
#

It will be vastly more performant anyway

calm coral
wintry quarry
#

So it's worth it for that reason alone

jovial peak
#

oh, that is super useful! guess ill have to find a guide to create a png with editor scripts

calm coral
# summer stump Yep
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Random = UnityEngine.Random;

public class MouseController : MonoBehaviour
{

    public float mouseSenstivity = 100f;

    public Transform PlayerBody;

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        float mouseX = Input.GetAxis("Mouse X"); * mouseSenstivity * Time.deltaTime;
        float mouseY = Input.GetAxis("Mouse Y"); * mouseSenstivity * Time.deltaTime;

        PlayerBody.Rotate(Vector3.up *  mouseX);
    }
}
```its content
summer stump
#

It should be only one change, but who knows

Edit: I do appreciate the assist though!

timid quartz
#

Seeing this error: InvalidCastException: Specified cast is not valid.

The code:
foreach (CardHolder holder in HandHolderHolder.transform) { if (holder.owner == GetActiveCharacter()) { holder.gameObject.SetActive(true); } else { holder.gameObject.SetActive(false); } }

I thought I could do a foreach on a transform and it would be the children?

north kiln
#

It can only be Transform, you can't foreach component children like that

timid quartz
#

so:
foreach (Transform holder in HandHolderHolder.transform) { if (holder.GetComponent<CardHolder>().owner == GetActiveCharacter()) { holder.gameObject.SetActive(true); } else { holder.gameObject.SetActive(false); } }

north kiln
#

Yes, if the children all have the CardHolder component that should work

calm coral
timid quartz
#

is there a better way of grabbing data from each child?

calm coral
#

Something like List<CardHolder> cardsHolderList = new(); and in your CardHolder class use OnEnable() and OnDisable() methods to add itself to that list

#

But that's optimization matter, if your script is going to work and not iterate a lot then should be fine anyway

#

Depends how many iterations or if it's a mobile project or PC

timid quartz
#

at most we're talking single digits, each of these holders represent 1 party member

#

it's a worthwhile concern though and I'm glad you mentioned it to me!

#

thanks for the help!

calm coral
timid quartz
#

unrelated, ocassionally I see this error:
ArgumentNullException: Value cannot be null. Parameter name: _unity_self UnityEditor.SerializedObject.FindProperty (System.String propertyPath) (at <fe7039efe678478d9c83e73bc6a6566d>:0)

#

this is just Unity having trouble for no reason and is nothing to worry about, right?

north kiln
#

As with any error if it's not originating from code you control it's more than likely just an editor bug that you can clear and ignore unless it's actually stopping you

calm coral
#

I have this error present since forever, I couldn't get rid of it but my scripts work anyway shrugs

ashen ferry
#

should not be capturing when there is hot control huh

timid quartz
#

is there some known weirdness for when something is instantiated already colliding with an object in 2d and the collision isn't reported?

timid quartz
#

Having trouble with some 2d collision. the code is really barebones:

void OnCollisionEnter2D( Collision2D other ) { if (other.gameObject.tag == "CardHolder") { // we are back! print("card zone"); } }

am I missing something really obvious?

#

oh whoops I think it's the trigger checkbox

#

nvm yep that was it, sorry about that

versed light
#

how do you check if code is being run in edit mode ? since i need to either use Destroy() or DestroyImmediate() depending on context

cosmic dew
#

i am having an issue while building the game ,it show Grade Build Failed .

#

any solution for this i am trying for many days but nothing works

radiant glen
#

Hello! I am using github with unity to have two people working on one project, I just tried to do a commit but it said I was unable to as it was over the 100MB limit, what should I do to fix this issue?

undone inlet
#

I would like to ask if there is a way to have the ScrollView's Content's size automatically adjust according to the size of the sub-objects without using any LayoutGroup? Although LayoutGroup+ContentSize solves the problem, I don't want to have the LayoutGroup automatically resize the sub-objects

cosmic dew
#

will i show u the error of Gradle Build Failed

young warren
hybrid gust
#
void GenerateMesh(GenerationSettings settings)
    {

        terrainGameObjects = new GameObject[settings.mapSizeSquared];
        terrainMeshes = new Mesh[settings.mapSizeSquared];
       
        vertices = new Vector3[(settings.chunkSize + 1) * (settings.chunkSize + 1)];
        var offset = new Vector3();
        for (int chunk = 0; chunk <= (int)settings.mapSizeSquared; chunk++)
        {
            offset = new Vector3((int)settings.map_size * chunk, 0, (int)settings.map_size * chunk);
            for (int i = 0, z = 0; z <= settings.chunkSize; z++)
            {
                for (int x = 0; x <= settings.chunkSize; x++)
                {
                    vertices[i] = new Vector3(x, 0, z) + offset;
                    i++;
                }
            }
            triangles = new int[settings.chunkSize * settings.chunkSize * 6];
            int vert = 0;
            int tris = 0;

            for (int z = 0; z < settings.chunkSize; z++)
            {
                for (int x = 0; x < settings.chunkSize; x++)
                {
                    triangles[tris + 0] = vert + 0;
                    triangles[tris + 1] = vert + settings.chunkSize + 1;
                    triangles[tris + 2] = vert + 1;
                    triangles[tris + 3] = vert + 1;
                    triangles[tris + 4] = vert + settings.chunkSize + 1;
                    triangles[tris + 5] = vert + settings.chunkSize + 2;

                    vert++;
                    tris += 6;

                }
                vert++;
            }

            terrainGameObjects[chunk].AddComponent<MeshFilter>();
            terrainGameObjects[chunk].GetComponent<MeshFilter>().mesh = terrainMeshes[chunk];
            terrainMeshes[chunk].Clear();
            terrainMeshes[chunk].vertices = vertices;
            terrainMeshes[chunk].triangles = triangles;
            terrainMeshes[chunk].RecalculateNormals();
        }
    }```
#

Not sure if I am going crazy or not, but I am getting a Object ref not set to instance of object on the "terrainGameObjects[chunk].AddComponent<MeshFilter>();" line. Am I doing something wrong?

young warren
#

you can use the debugger to step through and see values

hybrid gust
#

When I checked with breakpoints nothing was

young warren
#

you're sure it's on that line?

hybrid gust
#

I'll double check to make sure I didn't missing something tho

#

Thats what the console is telling me, but im not sure anymore

young warren
#

clear console, save all scripts, then try again

hybrid gust
#

yeah im not sure ngl

#

I'm checking everything and there isn't one thing that is coming up null

#

Nothing on that line or anywhere else

#

oh you know what

#

I see my issue

#

The items in the index are null, but the index itself isnt

young warren
#

what was it?

#

ah

hybrid gust
#

array *

supple wasp
#

how can I make a multicolor slider

cosmic dew
#

showing this error whule building the game

fossil drum
sly bolt
#

yo guys , i have one doubt so i have these 98 spheres and they have 1 script attached to them which is common to all. Now there is an array of size 98 in which i want to insert these prefabs but due to unity limitations i cant do that so is there any way that when i add prefabs to any one object it will get updated in the script to all the other objects?

gaunt ice
#

i think you need to know what is static variable

#

if you want every object have an array that reference to other gameobjects consider fill one first then copy the array to others
or findobjectswithtag

pliant bridge
#

is it normal for the void OnTriggerStay2D to be getting triggered when a child game object collides with something instead of just the gameobject that has the script witht that void?
if so how do I avoid it? I want it to only check the collisions of the gameobject that has the script

modest dust
#

then all collisions on child objects get "transfered" to the parent that has the rigidbody

#

You could probably avoid that by adding a rigidbody to the child

silent valley
#

Hello. I'm just wondering how I can set a textmeshpro to only allow 4 characters at max. I'm doing a 4 digit keypad and at the moment, I can keep writing which will just overlap and look a mess. How do I prevent this?

modest dust
#

and check if the text is the correct size

#

otherwise cut to 4

river glade
modest dust
#

Shouldn't that be rot.y ?

#

Or currentY as in the CloseRoutine

#

Also

#

You're not assigning the new rotation to anything

#

You're just assigning it to the local variable newRot

#

Not to the actual door rotation

#

No wonder it doesn't rotate if you do not change it's rotation and just calculate it

#

You also don't need to type gameObject.transform

#

just transform is enough

#

and the if else in Toggle() could be changed for a ternary operation

#
StartCoroutine(open
    ? OpenRoutine()
    : CloseRoutine());

or in 1 line if you prefer that

river glade
#

Oh yes! beginner errors, I didn't notice that I wasn't assigning the new rotation, so it should be: transform.localRotation = Quaternion.Euler(rot.x, currentY, rot.z);
right?

modest dust
#

Also when exiting the while loop make sure to assign the rotation to the open/close rotation exactly

ashen ferry
#

coulda just use animator

#

btw im not at pc but u can use ternary operator like that? lol

modest dust
#

That's also a way to do it ^

modest dust
#

As long as it doesn't return void

#

It has to be an assignment

#

You're assigning a method param

ashen ferry
#

lol cool never thought about that kekW

river glade
modest dust
#

If you want to have it close immediately then just change the transition between animations to immediate so it won't wait for the other one to finish

#

Unless you want to close it from any point of the rotation

#

Then that's beyond me, I'm not that into animations, but I believe it also should be possible

#

Unless you had just one animation and changed it's speed to negative

river glade
river glade
modest dust
#

and base the Lerp around the time progress instead

#
for (float t = 0; t < ANIMATION_TIME; t += Time.deltaTime)
{
  float progress = t / ANIMATION_TIME;
  float currentY = Mathf.Lerp(startY, endY, progress);
  transform.localRotation = ...;
  yield return null;
}
transform.localRotation = endRotation;
modest dust
#

Be it even with 2 separate animations

short hazel
#

Two animations of one keyframe, one for the open position, and the other for the closed position. The open/close duration being the animation transition time

ashen ferry
short hazel
#

My message describes it

ashen ferry
#

you cant spam the animation then

river glade
#

lol

ashen ferry
#

with the door for example

short hazel
#

With transition interruptions yes

ashen ferry
#

make it stuck midway

#

what would happen it would teleport

#

to keyframe and then animate

modest dust
#

setting the normalized time (progress) of the animation to what you need

short hazel
#

Might as well just not use animations if it's just rotating around a pivot point lol

modest dust
#

So for example, if the closing animations is 0.75 done, then play the open animation from 0.25

#

1 - currentProgress

ashen ferry
#

aaaa might work

#

actually I kinda want it too now so asking

#

like if it was at frame 7 of opening but now im closing it it would go from that frame 7 back to 0

modest dust
#

if the animation is "linear" (so no ease-in/out, etc) then simply 1 animation + messing with the speed would have the same effect

#

speed: 1 (open), -1 (close)

long cypress
#

Hello guys a quick question

#

From where do you guys normally learn unity and c# for it?

short hazel
#

Unity Learn

modest dust
#

!learn

eternal falconBOT
#

🧑‍🏫 Unity Learn can offer you over 750 hours of free live and on-demand learning content for all levels of experience! Make sure to check it out at https://learn.unity.com/

short hazel
#

I'd advise learning C# alone first, then moving on to Unity

modest dust
#

But if you do not know C#, then start with C#

#

Either a book or an online course/tutorial, whatever suits you

long cypress
#

Ok thank you guys

#

!blender

eternal falconBOT
river glade
short hazel
#

Code in both coroutines is identical, that's why

#

You need to have a closeY variable and go towards that instead of openY in the closing coroutine

river glade
solid kite
#

Hey I'm looking for some help. I want my player to be able to look at a wall/big box, and make a hole in it by shooting their gun essentially. It has to be just big enough for them to enter, which is my problem. The solution seems like creating two meshes, one with a hole and one without, but the problem with that is that I want it to be dynamic, so it can be placed on any valid wall/surface. Is there any way to 'delete' the space? Another solution for me would be to allow the user to pass through space that is occupied by two objects, one of which is passable because it is set to IsTrigger, and the other isn't passable. When these two objects are overlapping, is there a way I could make that space passable?

slender nymph
solid kite
# slender nymph just so you know that isn't exactly an easy task. you'll likely need to modify t...

Ok thanks. Does the second solution sound easier? To me it seems like it should be doable (although obviously I dont know anything), I just can't find any solution online. To give context, what I'm doing is making portals that are basically the same as in Valve's portal game. I want to give the illusion that the player is actually 'walking' into the portal instead of being teleported as soon as they collide with it. So they need to be able to walk right up to the walls when there is a portal.

slender nymph
#

there's very likely a better way of handling that, and i'd recommend reading up on it. proper portals like that take a lot of work and just cutting into the mesh that the portal is attached to won't solve most of the issues you'd have with it

hushed hinge
#

a betatester showed me this and I also just noticed that like when I die and respawn this happens to the Devi enemies

hushed hinge
#

when i play the game, everything was fine and the enemies are fine but when I killed the devi enemies and when i die and respawn and when their respawn, they begin to glitch out like that

slender nymph
#

and also keep in mind that nobody here has context for what your game is supposed to do versus what it isn't supposed to do. so until you describe what it means to "glitch out like that" and what they are actually supposed to be doing nobody can really guess at what the fix is

queen adder
#

Have anyone tried comparing performance of 1000 Update() vs 1000 Coroutine yield return null; loops?

slender nymph
#

gimme a few and i'll test it with the performance testing package. i imaging the performance is going to be pretty similar though

queen adder
#

what is performance testing package?

queen adder
#

ah nvm, I suck at installing packages, gl testing sadok

slender nymph
#

oldest version of that also appears to require 2018+ so unless you've decided to modernize a bit you can't use it anyway

long cypress
#

why microgames are not available in editor 2022.3.10f1 ?

slender nymph
#

probably the templates have not been updated. this is a code channel though

long cypress
#

oh my bad

charred spoke
slender nymph
#

just got done actually

#

the X1K versions of the tests are running with 1000 objects each running either an Update or Coroutine. all i did in each test was increment a counter 1000 times in either Update or a Coroutine. the results, as expected, are very similar. with the coroutines having a higher max frame time likely due to the initial StartCoroutine call
@queen adder
also timing is in milliseconds

#

i should also note that this is per frame timing

queen adder
#

wait would take a while to digest

#

is that 26.28 bad?

#

kinda get it now

#

so they're pretty to almost similar on the runtime

slender nymph
#

yep, very similar in performance

ashen ferry
#

why is there such a gap between min and max for update if u do same thing each frame lol

slender nymph
#

this doesn't account for memory impact though, which i'm sure the coroutine would have a higher impact due to the number of IEnumerator instances created

queen adder
#

what if you have designed a coroutine loop that is purposed to run whole game?

lone sable
#

My Camera is rotated by 45 Degrees, and, I am trying to rotate the controller input properly to account for that. Whats the easiest way to handle that?

queen adder
#

will memory problem will be a matter of problem in that case?

lone sable
#

Currently I have this, but it doesn't seem to be correct.

        if (isController) {
            if (Camera.main == null) return;
            float radians = Camera.main.transform.localEulerAngles.y * Mathf.Deg2Rad;
            Vector2 offset = new Vector2(Mathf.Sin(radians), Mathf.Cos(radians));
            inContext += offset;
        }
slender nymph
lone sable
slender nymph
# queen adder will memory problem will be a matter of problem in that case?

a single coroutine will have less of a memory impact than 1000, yes. if you have actual performance concerns for how your game is set up though, use the profiler. this performance test is far from a real world example and should really only be taken as "the performance between a coroutine doing something versus update doing the exact same thing is very similar so choose whichever suits your needs best"

charred spoke
weak plaza
#
static bool IsCursorOverButton(Bounds customButton)
        {
            // Convert cursor position to world coordinates
            Vector2 screenPosition = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
            Vector3 mousePosition = UICamera.mainCamera.ScreenToWorldPoint(screenPosition);
            Console.WriteLine($"mousePosition:" + mousePosition.ToString());
            Console.WriteLine($"customButton:" + customButton.ToString());
            mousePosition.z = 0; // Ensure the z-coordinate is 0 (2D space)
            return customButton.Contains(new Vector2(mousePosition.x, mousePosition.y));
        }
if (IsCursorOverButton(uiButton))
            {
                Console.WriteLine("IsCursorOverButton(uiButton)");
            }
mousePosition:(0.61, -0.48, 0.00)
customButton:Center: (0.12, -0.52, 0.00), Extents: (0.19, 0.20, 0.00)
IsCursorOverButton(uiButton)

How is this possible?

fossil drum
weak plaza
tender flame
#

Dose anyone knows why my gyroscope dosen't work on the Android Build,even that I get the SystemInfo.supportsGyroscope as true.

The amazing part is that when i connect the phone to the pc and I use Unity Remote to test it,it works fine

weak plaza
#

center is 0.12 extent is 0.19
so should be (-0.07, 0.31)

#

but the mouse x is 0.61

long cypress
#

why this error coming whenever i am trying to interact with terrain and i can't edit the terrain

weak plaza
#

no where within the range to me

short hazel
long cypress
#

and this

red dirge
#

Does anybody have an idea on how to make an infinite generation map for a 2D game?

fossil drum
charred spoke
#

Seeded generation is also something useful

red dirge
red dirge
charred spoke
red dirge
#

I was also wondering if anybody have an idea on how to load and unload chunks of the map just like in Minecraft aswell

glossy eagle
#

Hi. Does anyone know if there's a way to make a heavy function like run in the background please? Like, having a function that is kinda demanding and be able to run it without the whole game just freezing please

eternal charm
#

@tacit forge you around mate?
Can't sent you a private message regarding your post on the forum.

glossy eagle
#

okay thanks

eternal charm
#

Careful with async it's not always the best option

glossy eagle
#

load a whole terrain from an image and set it as a heightmap of a terrain

eternal charm
#

Load then make sure your game state don't do stuff with the resource before it's loaded

glossy eagle
#

so like a wait until?

eternal charm
#

Yep
If your systems need the heightmap if you don't wait for the resource to be loaded... Welp, not gonna work

glossy eagle
#

makes sense. Thanks

eternal charm
#

Sounds obvious but double check that 😊

glossy eagle
#

yeah

weak plaza
#
static bool IsCursorOverButton(Bounds customButton)
        {
            // Convert cursor position to world coordinates
            Vector2 screenPosition = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
            Vector3 mousePosition = UICamera.mainCamera.ScreenToWorldPoint(screenPosition);
            Console.WriteLine($"mousePosition:" + mousePosition.ToString());
            Console.WriteLine($"customButton:" + customButton.ToString());
            mousePosition.z = 0; // Ensure the z-coordinate is 0 (2D space)
            return customButton.Contains(new Vector2(mousePosition.x, mousePosition.y));
        }
if (IsCursorOverButton(uiButton))
            {
                Console.WriteLine("IsCursorOverButton(uiButton)");
            }
mousePosition:(0.61, -0.48, 0.00)
customButton:Center: (0.12, -0.52, 0.00), Extents: (0.19, 0.20, 0.00)
IsCursorOverButton(uiButton)

How is this possible?

wintry quarry
#

What are we looking at here?

silent valley
#

Hi. This is an extremely newbie question. I'm just trying to get my player to debug a message whenever it collides with a new tag. I've tried all sorts and spent hours looking and I'm getting 0 progress. i'm using the OnCollisionEnter method

silent valley
#

right now. I scrapped everything and I'm back to square 1

wintry quarry
silent valley
#

Just to tell me what object I'm colliding with then I can start coding

wintry quarry
#

what is this code printing?

#

It's not a quiz

#

I'm asking you to run the game

rich adder
wintry quarry
#

and tell us what it's printing

tender flame
silent valley
rich adder
small nebula
#

hello friends, I have a list of objects. I want the last element of it , comes up in order and be the first element, how to do that!?

wintry quarry
wintry quarry
#

YOu can do it but it's kinda slow. There may be better data structures to use if you want that.

wintry quarry
#

but

var last = myList[^1];
myList.RemoveAt(myList.Count - 1);
myList.Insert(0, last);```
wintry quarry
#

it's an O(n) operation

#

it can be quite slow if you do this frequently

#

So I'm asking WHY you're doing this, because there might be a more efficient way to solve your problem

small nebula
wintry quarry
#

It would be faster if you use a LinkedList instead of a List

#

but LinkedLists are slower for many typical operations

hidden citrus
#

is using shader graph to create a masked material possible? or does it require shader code (as I've only seen online)?
It seems like the mask functionality breaks when a shader graph (nodes) material is used.
Or is it possible to create a custom mask script that forces the editor to render the mask component with a material?

wintry quarry
#

so it's a tradeoff

small nebula
small nebula
wintry quarry
queen adder
#

            Debug.Log("not so supper egg");
            GameManager.Instance.Late(() => Debug.Log("SUper egg"));



    public IEnumerator Late(System.Action act)
    {
        Debug.Log("swd");
        yield return null;
        act?.Invoke();
    }
```Why doesnt this work? what did i miss?
#

Instance exist and enabled

short hazel
#

Missing StartCoroutine

queen adder
#

oh..

wintry quarry
#

It will end up confusing you about which object the coroutine is tied to

#

Make the coroutine itself private and make a public function that starts the coroutine

queen adder
#

called like stopped

wintry quarry
#

Because the coroutine will not run on the game manager this way

queen adder
#

not even this mess? GameManager.Instance.StartCoroutine(GameManager.Instance.Late(() => save.AllItems = retrieved[4]));

wintry quarry
#

If you do this in the GameManager:

    public void DoLater(System.Action act) {
      StartCoroutine(Late(act));
    }
  
    private IEnumerator Late(System.Action act)
    {
        Debug.Log("swd");
        yield return null;
        act?.Invoke();
    }```
Now you just need to write:
```cs
GameManager.Instance.DoLater(() => Debug.Log("SUper egg"));```
And it's impossible to mess it up because "Late" is private
queen adder
#

that is neater yea imma do that

#

kinda works now thanks!

#

    public void Late(YieldInstruction delay, System.Action act)
    {
        StartCoroutine(late(delay, act));
    }
    
    public void Late(System.Action act)
    {
        StartCoroutine(late(act));
    }
    
    public void Late(float time, System.Action act)
    {
        StartCoroutine(late(time, act));
    }
    
        IEnumerator late(YieldInstruction delay, System.Action act)
        {
            yield return delay;
            act?.Invoke();
        }
        IEnumerator late(System.Action act)
        {
            Debug.Log("swd");
            yield return null;
            act?.Invoke();
        }
        IEnumerator late(float time, System.Action act)
        {
            yield return new WaitForSeconds(time);
            act?.Invoke();
        }```Here btw if anyone needs some mess concept
#

How do I have a Rigidbody's Rotation be linked to what direction it is going in?

rich adder
#

rb.rotation = newRotation
I think works too

#

mayb someone has a better way :p

wintry quarry
#

Good to do what exactly

rich adder
#

eh id use a raycast when grounded

wintry quarry
#

i don't see how that code would check if the player lands on the ground at all

#

it's also unclear when you're running it

somber osprey
#

Hi, I'm using the Unity Figma Bridge for my UI workflow... https://github.com/simonoliver/UnityFigmaBridge, it generates UI elements from my figma projects. When it generates an element with an image, it uses its special class FigmaImage (https://github.com/simonoliver/UnityFigmaBridge/blob/main/UnityFigmaBridge/Runtime/UI/FigmaImage.cs), it inherits form the base Image class from the UntiyEngine.UI namespace. I need to reference this script to be able to set some special properties, but I can't find it anywhere, it's intellisense isn't even detecting its namespace UnityFigmaBridge.Runtime.UI... I've noticed that the extension is separated into 3 folders: Assets, Editor, Runtime, the script is in the Runtime folder, maybe this has something to do with it... Thank you guys in advance

languid spire
#

there are so many 'its' in there I have no idea what you are actually missing

somber osprey
#

The FigmaImage component script

swift crag
#

Regenerate project files and try again. Preferences > External Tools

#

I would also close and reopen the code editor.

lapis veldt
#

Hello. I have watched a youtube tutorial about making a small 2d game for mobile where you need to dodge some boxes falling from the skies. Everything works fine, but the only problem I have is that the score is increasing after the box reaches the middle of the screen. Scoring should be updated after the box passes the player not while generating the box, how to do that ?

somber osprey
#

Yeah, no, it's not an omnisharp error, I even checked omnisharp logs

lapis veldt
#

can I write the code here (in the thread) or is there a forum for questions?

swift crag
#

it would be no different from using any type that your editor isn't aware of

swift crag
lapis veldt
swift crag
#

when the box enters the collider, add a point

lapis veldt
#

Hello I have watched a youtube tutorial

lapis veldt
somber osprey
# swift crag missing .csproj files wouldn't be an "error"

Yeah, I know. The things is, I don't think this the assembly was even supposed to be in my project, maybe it was only supposed to be used by the unity runtime and the editor. When I say error, I meant that that I checked and both omnisharp and mono were getting the same assemblies.

#

I'm not really aware of how unity handles its packages, but I guess I can always fork the package and try to move the script to the Assets directory...

swift crag
#

You could use the current transform.up as the "up" direction for the look rotation

#
Quaternion.LookRotation(rb.velocity, rb.transform.up);
#

The resulting rotation will be rolled so that the "up" direction (from the perspective of the rotation) is pointing that way

queen adder
#

ok that might work
but I actually want the MODEL to be looking in the direction of the Velocity

swift crag
#

that's exactly what this would do

#

elaborate?

queen adder
swift crag
#

show your code.

queen adder
#

`` public class Movement : MonoBehaviour
{
public Rigidbody player;

private Vector3 playermovement;

public float movementspeed;

// Start is called before the first frame update
void Start()
{
    
}

// Update is called once per frame
void Update()
{
    float x_axis = Input.GetAxis("Horizontal");
    float z_axis = Input.GetAxis("Vertical");

    float timer = movementspeed * Time.deltaTime;

    playermovement = Vector3.right * x_axis * timer + Vector3.forward * z_axis * timer;

    player.position = player.position + playermovement;

    Quaternion newDirection = Quaternion.LookRotation(player.velocity.normalized, player.transform.up);

    player.rotation = newDirection;
}

}``

swift crag
#

please share it correctly -- wrap it in triple backticks

#

!code

eternal falconBOT
#
Posting code

📃 Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

queen adder
#
{
    public Rigidbody player;

    private Vector3 playermovement;

    public float movementspeed;

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        float x_axis = Input.GetAxis("Horizontal");
        float z_axis = Input.GetAxis("Vertical");

        float timer = movementspeed * Time.deltaTime;

        playermovement = Vector3.right * x_axis * timer + Vector3.forward * z_axis * timer;

        player.position = player.position + playermovement;

        Quaternion newDirection = Quaternion.LookRotation(player.velocity.normalized, player.transform.up);

        player.rotation = newDirection;
    }
}```
swift crag
#

did the original suggestion work?

#

i.e. just doing Quaternion.LookRotation(player.velocity.normalized)

queen adder
#

Ill check

#

nope its still the same rotation

#

Though I think the Look Rotation Vector is 0 thing might relate to it

swift crag
#

internet died.

#

you are setting the position directly

#

so you have no velocity

#

you can use the playermovement vector instead of player.velocity

somber osprey
queen adder
swift crag
#

oh, you're just setting the position of the rigidbody every frame

#

it's not going to have a velocity

#

and there comes back the internet

swift crag
#

Setting the rigidbody's position teleports it, which makes it more likely for it to go through walls

river halo
#

Can you help me? I was going to duplicate an object and level it, but this error appeared. How to solve this error?

ashen ferry
#

do u use visual scripting?

river halo
#

yes

#

I use

ashen ferry
#

aa idk prolly can ignore it then

sly bolt
#

hello once again , short description of what im trying to do - carry out division operation of two spheres (one from left and one from right) one of the left is generated by user input and one on right is randomised the operation is carried out by assigning numeric values to spheres and then using formula in script which would execute after collision , so here is the recording of the issue im facing (apparently the bigger sphere should undergo division and should change into sphere of resulting number and the smaller sphere should get destroyed upon impact) , will send scripts later on if needed

ashen ferry
#

noone can help you without the code bro + why do you need to divide instead of subtracting ?

river halo
ashen ferry
#

I had same warning in like empty project few weeks ago but I dont use visual scripting so removed it

river halo
#

So how did you remove it? Maybe this might help.

ashen ferry
#

at the top go to window -> package manager then type into search bar "visual scripting" and theres remove button bottom right

sly bolt
#
river halo
#

I tried what you said and the problem was solved, thank you

hybrid gust
#

So from what I see most tutorial and things on the internet, most grid systems create the grid from a corener of said gird. Is there a tutorial or something someone can point me to that had a grid generate "outward"?

#

from an origin of 0, 0

rancid tinsel
#

is there a version of this for the "actual" scale (as in if the parent alters the scale of the gameobject etc)

ashen ferry
sly bolt
cosmic dew
#

BlinDeex do you Know about gradle Build Failed. Plz dont ignore

slender nymph
cosmic dew
#

not getting resopnse from their

slender nymph
#

that doesn't mean you should start crossposting to irrelevant channels

rocky canyon
#

when someone that has the knowledge see's it they'll respond..
like boxfriend said, if the post office is closed you don't drive down the road to the animal shelter and ask them to mail it instead lol

hybrid gust
#

😏

rocky canyon
#

🤔

#

lol

cosmic dew
#

i am also beginner so i came here

slender nymph
#

this is a code channel. not a gradle build error channel

rocky canyon
#

thats fair.. just try to keep things relevant to the channel.. odds are that in the wrong channel ppl just arent familiar

#

i myself have never built a mobile game

zealous oxide
#

hey friends, this is a bit embarrasing for me but i've made a new enemy for my platformer but it wont stop falling through platforms. https://hastebin.com/share/iguqorecij.csharp i've got a player character AND coins that stop on the platform but for some reason this new enemy falls through it

pine edge
#

Hey guys how would I tie colour to a float value? I want to have it that it goes from a default colour (white right now, but should be modifiable) to red (also modifiable), based on a character's "heat" level (float). at 0 heat, colour should be fully white, at X heat, colour should be fully red.

pine edge
slender nymph
zealous oxide