#💻┃code-beginner

1 messages · Page 553 of 1

minor radish
#

I found it but what should I do is it already updating ?

cosmic dagger
#

If using transform.position to move, make sure to use Lerp, MoveTowards, or a coroutine to interpolate its movement . . .

#

Though, you'll still have a problem with collision. You'll need to handle that manually using raycasts and physics checks methods . . .

frail wind
#

place it like this [ Lerp.transform.positsion ]

cosmic dagger
minor radish
#

Anyone I don't know what to do ?

burnt vapor
#

Select the Help > Check for Updates menu.
If an update is available, the Visual Studio Installer shows a new version. Select Update.

whole cliff
#

Can't add script component 'TRIGGER script' because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name match.

#

does anybody know how to fix this?

frail hawk
#

it is actually clear

burnt vapor
languid spire
#

did you do what the message tells you to do

burnt vapor
#

Check your console

whole cliff
#

i started today so im very new

burnt vapor
whole cliff
#

it doesnt say anything

burnt vapor
#

The issue is somewhat clear already, your editor is probably not configured. However, you should share the exception to confirm

wintry quarry
burnt vapor
#

Alternatively it just didn't compile, which is the same problem

whole cliff
wintry quarry
#

you're in play mode

#

stop the game

whole cliff
#

i did now

wintry quarry
#

also try not to include the nvidia overlay in your screenshots

whole cliff
#

yeah sorry wait

wintry quarry
#

If the console is empty, then it's probably, like the error said, that your filename and class name do not match

whole cliff
#

wait

#

my bad

#

it says nothing

wintry quarry
#

Given the name of this script file seems to have a space in it, then it's pretty clear the filename and class name do not match

#

So you need to fix that

whole cliff
#

there is no space now and it still doesnt work

wintry quarry
#

Does the filename match the class name?

#

That's what you need to happen

whole cliff
#

what is the class name?

wintry quarry
#

public class <?????>

#

for example

#

in a file called Goldfish.cs, you would name your class public class Goldfish

whole cliff
#

the tutorial i followed didnt do that and it was working for him

wintry quarry
#

I disagree

#

the tutorial you followed definitely did that

whole cliff
#

oh

wintry quarry
#

it doesn't work if you don't do that

burnt vapor
#

Unity generally handles the names for you, but if you decide to add a space initially it's going to mess up

whole cliff
#

ohhh wait

#

maybe this is the problem

wintry quarry
whole cliff
wintry quarry
# whole cliff

i mean seeing as it STILL has a space in it, it's definitely the problem

#

because class names cannot have spaces

minor radish
#

It's already up to date and nothing happen

frail wind
#

for some reason unity think that [ target.position ] didn't exist and i can put that in. why is this happen?

whole cliff
#

how do i change it?

wintry quarry
whole cliff
#

well how do i just fix it

wintry quarry
#

click on it once to select it, then click it again and wait. You can rename it

burnt vapor
wintry quarry
#

Or right click and rename it

frail wind
#

nvm

#

i just need to add the target first lol

wintry quarry
whole cliff
#

yall gonna be hearing alot from me bc im THIS stupid

#

thanks alot!

frail hawk
#

quick tip , if you want ot rename a script inside unity go into visual studio (if you are using it) and rename the classname from the context menu, it will also rename your unity script

whole cliff
#

can i use pyton for scripting beacause i feel like it would be easier

wintry quarry
#

no

#

you cannot

whole cliff
#

oh

red igloo
#

Hey so I am a total beginner, I know how to use unity itself but for the coding part I have 0 knowledge. I am more interested in making 3D games than 2D. How can I make myself get better at coding? I tried watching some tutorials which didn't help at all any advice?

whole cliff
#

then imma learn c#

frail hawk
minor radish
burnt vapor
#

I strongly suggest you configure it properly. It's a pain in the ass to work without it

minor radish
minor radish
#

Okay I have to doanload it manually then ?

languid spire
#

no, you just have to follow the configuration steps exactly

minor radish
#

I did it and it doesn't work

languid spire
#

then you did it wrong, it's worked for 1000's of other people

burnt vapor
#

I suggest you just install VS manually since it's less tedious

minor radish
mortal fog
#

I have this code running in update, however only the first weapon that gets added to the list equippedWeapons is activating its Fire function. I have tested that multiple weapons are in the list, it's just that only the first to be added is calling the fire function. Weapons are added through the second function.

//running in update, firing logic happens in the WeaponBase
foreach (WeaponBase weapon in equippedWeapons)
{
    weapon.Fire();
}

public void EquipWeapon(WeaponBase newWeapon)
{
    if (!equippedWeapons.Contains(newWeapon))
    {
        upgradePool.weaponPool.Remove(newWeapon);
        equippedWeapons.Add(newWeapon);
        Debug.Log($"Weapon {newWeapon.weaponName} equipped.");
        newWeapon.player = gameObject;
    }
}
#

This code is in the WeaponBase class

    public void Fire()
    {
        if (Time.time >= timeSinceLastShot + 1f / fireRate)
        {
            timeSinceLastShot = Time.time;
            PerformFire();
        }
    }

    protected abstract void PerformFire();
obsidian dagger
#

Has the velocity changed to linear velocity?

mortal fog
#

yeah use linearVelocity now

obsidian dagger
#

Gotchu, so instead of velocity.x itd be linearVelocityX

mortal fog
#

linearVelocity.x

#

mb you are right

#

whoops

wintry quarry
naive pawn
frail wind
#

is it necessary to add Time.deltaTime in this code line [ transform.position -= (Vector3.MoveTowards(a, b, moveSpeed)); ]

frail hawk
#

yes

wintry quarry
frail wind
#

beacuse if i add deltaTime the collision doesn't set in

wintry quarry
#

assuming this code is running in Update

wintry quarry
#

you should not be moving via transform.position at all

#

and it has nothing to do with deltaTime or not

#

You need to move via the Rigidbody if you want collisions to work

frail hawk
frail wind
#

yeah but like if my frame rate was high then the object would move faster without delta time right?

frail hawk
#

true

frail wind
#

btw i run [ transform.position -= (Vector3.MoveTowards(a, b, moveSpeed)); ] in fixedUpdate

frail hawk
#

not good

limber epoch
#

Hey guys, I need help with this error. I got Photon Quantum working, but Photon Voice 2 isn't being imported and this keeps popping up

wintry quarry
#

Anyway you should NOT be moving via the Transform regardless

mortal fog
wintry quarry
#

as mentioned several times.

wintry quarry
#

what makes you think it's not working

#

Did you make timeSinceLastShot static or something?

mortal fog
#

yes

wintry quarry
#

put logs inside Fire in and out of that if statement

wintry quarry
#

all your weapons are sharing the same cooldown now

finite heron
#

for some reason, my jump animation isnt initating or doing anything actually, does anyone know how to resolve this issue? I genuinely cannot see my mistake

frail wind
#

is ther any method to keep collision on object while also not making it update everyframe that make object go so fast

#

hello?

#

how about i use transform.Translate

wintry quarry
#

Move it via the Rigidbody

wintry quarry
frail wind
#

oh

#

i see

#

if i use Rigidbody then disable gravity then i will keep collison on on my spike

whole cliff
#

im back again!

#

how do i fix this?

wintry quarry
#

and then never close it again

#

you should always have it open

#

Then, like it says, fix all your compile errors

whole cliff
#

yeah i did that on accident

#

Assets\scripts\triggerscript.cs(8,26): error CS1002: ; expected

Assets\scripts\triggerscript.cs(9,6): error CS1513: } expected

#

what are these type of errors?

wintry quarry
#

these are compile errors

#

looks like basic syntax errors

whole cliff
#

hoe do i fix them?

wintry quarry
#

By opening the scripts they are pointing to

#

and looking at the line they are referring to

#

and fixing the code

#

You wrote invalid C# code.

#

In this case in triggerscript.cs on lines 8 and 9

#

The first one says " ; expected" which means you forgot a semicolon
The second one says } expected which means you forgot a } but it couold also mean you just generally wrote things improperly and it's confused.

wintry quarry
#

THe one I asked about is between Any State and Player_Jump

finite heron
#

oh sorry, I missread

whole cliff
#

i have good and bad news

finite heron
whole cliff
#

the code was rewritten for me

#

but there is now a extra error

#

Should not be capturing when there is a hotcontrol
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

wintry quarry
#

ChatGPT?

whole cliff
#

like they changed my code

wintry quarry
#

Who did

#

who is "they"?

whole cliff
wintry quarry
#

Unity doesn't change or rewrite code for you.

whole cliff
#

maybe this hobby is not for me

#

this shit is making me soo confused

#

like tf is this

verbal dome
#

That is very confusing indeed

humble hound
#

Hii everyone

verbal dome
#

The pins of this channel have C# beginner courses if you wanna actually learn

humble hound
#

can i use kinematic character controller to help make a dragon/bird controller

charred spoke
#

Do you mean KCC from the asset store ?

humble hound
#

yea

whole cliff
#

wait guys

#

i feel like im getting the hang of it

humble hound
whole cliff
#

what could i use instead of private

#

bc thats my last error

#

@wintry quarry could u help me?

charred spoke
#

Well you could make it work for a flying character as well, it’s kinematic it just goes where you tell it to.

humble hound
#

ok

fervent abyss
#

i do it like this:

targetTransform.localRotation = Quaternion.Euler(targetTransform.localEulerAngles.x, rotationReference.localEulerAngles.x, targetTransform.localEulerAngles.z);
cosmic dagger
# whole cliff maybe this hobby is not for me

You don't unlock the mysteries of coding and game dev in a day. It's an adventure: a journey of perils, with trials and tribulations waged upon your character. It's not an afternoon stroll through the park . . .

#

Just take it one step at a time: one tutorial/article. Redo it again. Make sure you understand every line of code before continuing. Most of all, discipline over motivation . . .

lament agate
#

Hello , Im trying to learn about gpu instancing. Im following some simple yt tutorial, but it doesnt work. I tried to google the error but idk what to do with it. Can someone give me an advice?

finite heron
swift crag
#

it seems very reasonable given that you have three dimensions to work with...

lament agate
#

I hardly understand anything from it, i just followed simple unity tutorial 😄

swift crag
#

DrawMeshInstanced is obsolete, according to the docs

#

you want to use RenderMeshInstanced

lament agate
#

@swift crag something like this ? Graphics.RenderMeshInstanced<Mesh, 0, material, metrices>; it gives me erors

swift crag
#

well, definitely not with that syntax...

lament agate
#

@swift crag It worked. Thank you. Do u know maybe some good tutorial on gpu instancing ?

swift crag
lament agate
#

@swift crag ok , thanks 😉

fervent abyss
#

omg can u help me with this

#

im bouta snap fr 😭

verbal dome
#

Is your gizmo set to Global or Local in this video?

#

Ok I see it's local

verbal dome
#

Euler angles are tricky.. You could try something like targetTransform.forward/up/right = rotationReference.forward/up/right depending on how those things are oriented
Edit: Made the variable names match your example

#

There are better ways to do this but brain fog is real right now

swift crag
#

yeah, I try to avoid directly working with Euler angles when I can help it

verbal dome
#

You could also try additively rotating the hand around an axis with RotateAround, assuming that the character is animated every frame

cosmic quail
swift crag
fervent abyss
swift crag
fervent abyss
swift crag
#

You could specify the axis in the inspector

fervent abyss
#

the up/right/forward is broken for me

fervent abyss
cosmic quail
#

yeah a good reusable script would be to define in the inspector which axis it should be rotating around

fervent abyss
#

the axis is locked on 180 because quartenion

swift crag
#

they produce interesting behaviors

fervent abyss
#

like theres no way its that hard 😭

cosmic quail
# fervent abyss like theres no way its that hard 😭

Instant Unity Tips is back!
Let's kick this off with a simple but versatile C# script to rotate any object.

Car model by Kenney (Free - CC0) https://kenney.nl/assets/car-kit

Transcript:
Let's make an object rotate infinitely on any axis you want and at any speed you want. First, let's go add a component. Let's name it Rotate and open it up i...

▶ Play video
#

2 minute video

fervent abyss
verbal dome
#

Show the orientation of your hand object

#

Select it with gizmos in local and show us

#

The orientation is slightly weird, I usually expect bones to have the Y or Z as forward, not X

#

Not sure if that matters here tho

fervent abyss
#

it doesnt

swift crag
verbal dome
#

Z would be preferred since euler angles are applied in the order Z > X > Y so the Z wouldn't interfere with the other axes

fervent abyss
#

im so tiredddddd with thissssss 😭

verbal dome
#

What else is rotating the hand? Does it have an animator running?

fervent abyss
#

but i think it doesnt really matter since the problem is that the rotation is limited?

mortal cedar
#

hello ! i 'm trying to make a 2d game on unity but i have a problem, i want an enemy to follow the player when he attacks for the first time, the player has a sword and a variable called "HasAttacked" in the sword script and i call it to the enemy script by typing "public Sword sword;" and if (sword.HasAttacked) {
isFollowing = true;
It works but when i put my enemy in the prefab folder the script of the sword (and the player) disappear and i can't put them back in. Picture of the prefab enemy here:
does someone know what to do ?

proper needle
#

exact same settings, but only one key glows. Am I doing something wrong

fervent abyss
wintry quarry
wintry quarry
#

Depends why it needs that reference

#

But get it opportunistically

fervent abyss
wintry quarry
#

Or have the enemy spawner pass it to the enemy

verbal dome
mortal cedar
wintry quarry
mortal cedar
verbal dome
#

Btw is your gizmo set to Center, not Pivot?

#

Use Pivot

mortal cedar
#

i just need the big foots to be notified when the player attacks for the first time

fervent abyss
wintry quarry
proper needle
fervent abyss
mortal cedar
proper needle
fervent abyss
#

physics and math suck for quartenion

tough trench
#

Does anyone know why I can't add my script to anything

fervent abyss
#

nvm im so done

verbal dome
#

Now it's facing the correct way in the Z axis but it doesn't know which way to face the X axis

fervent abyss
#

WHY IS IT SO HARD its supposed to be easier 😭

verbal dome
fervent abyss
#

im just tired and brain fog is coming

#

as well as my wifi is DYING

frail hawk
tough trench
#

anyone know how to fix these

languid spire
robust condor
#

What way is it best to achieve the following. I have an ability system where player clicks an ability then a target. The selected character shoots a projectile or a spell from character toward the target. The game is turn based and enemies are static (3D). Should I still spawn gameobjects and projectile them and check for colliders, or should I use particle system? You can't miss if you click incorrectly. I need a projectile travel effect and one effect when it hits the enemy. Particles can't detect collision so I should use some kind of duration timer calculated by range? It seems more complicated than spawning gameobjects. It's basically like Baldurs Gate 3 when using a spell or ability.

verbal dome
#

IMO depending on particle collisions for anything that affects the gameplay feels wrong

swift crag
#

yeah

robust condor
#

Right, so using gameobjects the only way to detect when I should initiate the explosion effect is to check the collider hit?

verbal dome
#

You could do a ray/spherecast also

#

You can't miss if you click incorrectly.
Clarify this part a bit?

#

Is it like arcadey in the sense that it's not about aiming

robust condor
#

It's not an aiming system, you click a target or you don't, if you don't click the enemy collider you can't shoot anything, IE the ground

verbal dome
#

More about stats/dice rolls

verbal dome
robust condor
#

Kinda like in final fantasy where you use a little hand to select the target

#

No I just need to make sure the projectile whe it travels has an effect, like a fireball and when it arrives on the target it needs to explode

verbal dome
#

And you determine if it hits or not, right when you shoot?

robust condor
#

Yeah

verbal dome
#

I should use some kind of duration timer calculated by range?
I think you are on the right track here

#

You could use colliders and physics for this, I just think calculating it yourself is more reliable/aligns better visually

#

Is it turn based?

robust condor
#

Yes

#

There seems to be something called ParticleCollisionEvent

verbal dome
#

Yes, particles can have collisions

#

If it's purely visual then you can use that

robust condor
#

How do I make the projectile arc when traveling with particles? Can I arc a raycast and make it follow it?

verbal dome
#

You could make an arc of multiple raycasts, but what is the point of the raycast then

wet lark
#

chat question about instance ID, is it ideal to use it for find and search or should i make a different ID. Example searching through an Inventory System for a dictionary that uses it as the key?

verbal dome
#

You could just calculate like a parabola and move the particles along that path

robust condor
#

Ah yeah I know the pos of the character and the enemy, so I can just move the particle along the arc

verbal dome
wet lark
swift crag
#

Also unusuable.

verbal dome
swift crag
#

If you want to be able to identify an asset, consider copying its asset-database GUID into a field on the object!

#

I use this all over the place in my game

verbal dome
#

I should probably do that too instead of having a component with an ID on everything

swift crag
#

I also use GUIDs on a few non-assets

#

like specific components in my entity prefabs

#

in that case, I just generate one

verbal dome
#

System.Guid, right?

swift crag
#

Nah, that can't be serialized by unity

#

you have to create your own bootleg guid

verbal dome
#

Right

swift crag
#

I want to rename the fields in my guid class

#

that's going to cause so many goddamn changes

robust condor
#

How does this work if you have a diablo like loot system where things are randomized?

verbal dome
#

I do have an "UniqueID" class that contains a hash
The hash is generated from a Guid

#

Should probably use long instead of int tho..

swift crag
#

Randomly generated loot will still probably point at a template

#

(and the modifiers might also point at templates of their own!)

robust condor
#

There is a scriptable object as the base, but it has ranges, how would you store the ranges it spawned?

swift crag
#

but the actual modifier data would be part of the item itself

#
[Serializable]
public class Item {
  public ItemSpec specification;
  public List<Modifier> modifiers;
}
#

extremely rough example

verbal dome
robust condor
#

Seems like you need to store the entire thing no?

swift crag
#

unity will update every single damn guid properly

#

it's just going to be one hell of a commit

swift crag
#

Modifier might also contain some GUIDs (e.g. a modifier that adds a stat bonus would need to identify which stat it affects)

#

and stats themselves can be assets!

#

no need for them to be an enum that you're terrified of rearranging

robust condor
#

I am thinking composable, SwordSO, FireModSO, ColdModSO ?

swift crag
#

I would not have a separate class for every kind of elemental effect -- that's too granular

#

I'd have ElementSO (defines a kind of element) and an ElementModSO (defines a modifier that adds an element to a weapon)

#

actually

#

nah, scratch the latter

#

there would be a plain old class called ElementalModifier that stores:

  • the strength of the modifier
  • a reference to an ElementSO
swift crag
wet lark
robust condor
#

Probably, I am just speculating at this point

#

I do want the weapons to affect the characters attributes

wet lark
#

i am doing something similar but i am using a ModifierSO, its like a Single modifierSO with a list of StatModifier serializable struct object

robust condor
#

Also on particles, if I create an arrow particle that I want to stick to an enemys head permanently once it hits, is there any downside to have it linger for infinite duration?

verbal dome
#

With a gameobject it's very doable tho

#

The downside being the rendering cost of the stuck arrows (probably negligible)

#

Unless you let your character pincushion its enemy with 1000 arrows

#

Might wanna add a limit

robust condor
#

I saw a vfx video where they shot a projectile at a wall and it stuck on it for like 3 secs after hitting

swift crag
#

The wall doesn't move!

#

that's the hard part 😉

#

I've been fussing with kind of thing for VRChat

#

You could certainly spawn an object to replace the particle, then parent it to the appropriate bone

robust condor
#

Oh you cant have the particle as a child of the object or something?

swift crag
#

No, you can't do anything like that for individual particles

robust condor
#

I see

swift crag
#

You could attach a particle system to the enemy's head bone and play a particle in the same spot

#

but that sounds a bit silly

verbal dome
#

Yeah might as well just use a GO at that point

#

Well, meshrenderer+meshfilter to be more specific

swift crag
#

If you need to stick a LOT of arrows to a lot of different things, you might look into more advanced rendering techniques

#

you could store a list of transforms and Matrix4x4s -- one four each arrow

#

then you could compute the correct matrix for each arrow every frame and then render them all at once

#

but that's quite a leap

urban sluice
#

Anyone got any idea why this doesn't work? Basically I want 1 of the first 2 conditions to be met and the third one. Every single one works on their own, but not when bundled like this.

swift crag
#

what is velocity?

#

consider logging the relevant values to find out if they're all true at the same time

urban sluice
urban sluice
swift crag
#

maybe clicking is causing a tiny mouse movement (I have no idea how much "1" is here)

urban sluice
#

I had it be without clicking and it worked

#

But clicking on it's own also worked

swift crag
#

Log all of the values together to check

#
Debug.Log($"Velocity: {velocity} /// Mouse: {Input.GetMouseButtonDown(0)}");
#

string interpolation, yum

swift crag
cosmic dagger
# urban sluice Doesn't print just work?

You are correct, but Debug.Log works inside of any class. Print is only available when the script derives from MonoBehaviour. That's why you'll see most people use Log instead . . .

swift crag
#

i also don't like how print is lowercased

urban sluice
swift crag
#

Yes

urban sluice
swift crag
#

GetMouseButtonDown returns true for one frame

cosmic dagger
urban sluice
#

that is very stupid

swift crag
cosmic dagger
swift crag
urban sluice
urban sluice
swift crag
#

The point is to detect that you just clicked the mouse

#

so that you don't, for example, fire a gun every single frame

urban sluice
bold plover
#

How many of these should I have checked in everyone's opinion?

swift crag
#

This determines which kinds of packages your code editor will be told about. I have it set like this

#

To be honest, I just picked these arbitrarily

bold plover
#

Fair. Wasn't sure how many of these were crucial but at cursory I think it's fine this way.

rocky canyon
sterile radish
#

how can i check when an animation has finished playing?

swift elbow
serene barn
#

''' private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.CompareTag("Enemy"))
{
Destroy(gameObject);
loseText.SetActive(true);
}
}'''

#

anybody can help why this is not working when colliding

languid spire
#

is it even being executed?

serene barn
#

yes

#

but the if statement not

swift crag
#

How do you know that?

serene barn
#

because when i debug the function is called oncollision but not the if

polar acorn
polar acorn
#

Try logging the tag of the object you hit before the if

serene barn
finite heron
#

public class PlayerMovement : MonoBehaviour
{
    public CharacterController2D controller;
    public Animator animator;
    public float runSpeed = 30f;
    private float _horizontalMove = 0f;
    private bool _jump = false;
    //bool crouch = false;

    void Update()
    {
        _horizontalMove = Input.GetAxisRaw("Horizontal") * runSpeed;
        animator.SetFloat("Speed", Mathf.Abs(_horizontalMove));

        if (Input.GetButtonDown("Jump"))
        {
            _jump = true;
            animator.SetBool("IsJumping", true);
        }

    }

    public void OnLanding()
    {
        animator.SetBool("IsJumping", false);
    }

    void FixedUpdate()
    {
        controller.Move(_horizontalMove * Time.fixedDeltaTime, false, _jump);
        _jump = false;
    }

}```

I am having a slight issue with my setup, I want to play a 3 framed jump animation, the first frame to go up, the second to start falling and the third to land.

But with this code, it obviously starts the animation, and even if I havent landed yet, it switches to the running anim, is it possible for some way to play the 3rd frame until my character has landed?
verbal dome
#

Sounds like you want to enable "has exit time" on the transition out of the jump anim state

midnight jolt
#

Hi. After a year long break I'm getting back to Unity.

I'm trying to get an UI element to appear above a game object. While it does appear on the game objects, I can't get it to appear above...

Vector2 infoPanel = Camera.main.WorldToScreenPoint(gameObject.transform.position);
panel.transform.position = new Vector2(infoPanel.x, infoPanel.y + 5);```
#

this is how it looks like right now

swift crag
#

Consider adjusting the RectTransform's pivot point!

#

If you set the pivot to X=0.5, Y=1, then its "origin" will wind up being at its bottom-center

#

(or was it X=0.5, Y=0?)

#

turn left! no, the other left!

zenith cypress
#

You are also now working in pixels, so your + 5 is probably that part of the cube showing

swift crag
#

yep yep

midnight jolt
#

mb

#

works now

#

thank you both

sterile radish
#

hi, im currently making a doodle jump clone and im having a problem with the cracking platforms. below in my script, i start my FadeOut() coroutine but for some reason in runtime my cracking platform neither goes down or becomes transparent? however, it DOES destroy itself after the while loop is over

https://hastebin.skyra.pw/ziborolaro.pgsql

swift crag
#

hm, the code looks sensible enough

verbal dome
#

Yep

slender nymph
#

make sure nothing else is controlling those properties

verbal dome
#

Does it have an animator?

sterile radish
verbal dome
#

Noyce

slender nymph
#

yeah if the animator has animations that modify those properties then it will hijack all control over them (unless you change the properties each frame after the animator updates)

swift crag
#

(even if the current animation state doesn't control that property!)

verbal dome
#

Yeah, by default

#

I think that can be changed with "Write defaults" on the animator and/or in the state

swift crag
#

You'd think, but no!

#

"Write Defaults" controls what value you get for properties that don't currently have a motion that's controlling them

#

when enabled, you get the value that the animator saw when it turned on

#

when disabled, you get whatever value was last set by a motion

#

If you want to go clinically insane, try replacing all of your game's code with an Animator (i.e. create a VRChat avatar)

#

(WD On is generally more predictable)

#

I had a hilarious problem where an animation state that controlled a screen shake effect could exit slightly before it reached zero

#

I had WD Off, so the effect just...stayed there

#

random people would see their screen rattling near me

verbal dome
swift crag
#

the animator component does not have a "Write Defaults" property

#

this is a property on animation states

verbal dome
#

Oh, someone mentioned it some weeks ago when I brought up Write Defaults in the state

#

I have been bamboozled

swift crag
#

apparently the animator starts freaking out when you mix WD On and WD Off states

verbal dome
swift crag
#

ah, debug mode

verbal dome
#

Yeah I'm slowly transitioning into using Playables instead

swift crag
#

oh, it's ACTUALLY writeDefaultValuesOnDisable

#

exciting

valid vector
#

why is my navmesh not working

frosty hound
#

"Not working" is too vague. What's not working about it?

valid vector
#

its just not moving

verbal dome
#

Note that the path may not become available until after a few frames later. While the path is being computed, pathPending will be true. If a valid path becomes available then the agent will resume movement.

#

Think the problem is calling that in update

languid spire
valid vector
#

so how do i make it work then

languid spire
#

dont do that

verbal dome
#

Don't call it if path is pending

slender nymph
valid vector
#

how

#

wait no would this work

wintry quarry
valid vector
#

because its not working

verbal dome
#

Have you assigned everything in the inspector? target and agent

wintry quarry
verbal dome
#

If you didn't, you should be seeing errors

wintry quarry
#

Have you checked your console to see any errors etc?

valid vector
timber hound
#

hi, can i get some help?
im doing the pathway for beginner programming, making a door trigger, followed everything literally to a tea and still no trigger is happening

valid vector
wintry quarry
#

But - presumably, you didn't follow everything properly.

#

Show what you tried

wintry quarry
timber hound
cosmic quail
wintry quarry
timber hound
wintry quarry
cosmic quail
wintry quarry
timber hound
#

untagged, damn i didnt see it

cosmic quail
#

😔

timber hound
#

works now, i mean....... let me sit my stupid a** down

#

actually, im looking the word tag in the tutorial its now showing

#

maybe its in earlier tutorials?

#

omg i skipped to "more things to try" by mistake without doing all the beginning lmao

acoustic belfry
#

hi, what function can work for delay? Cuz im trying to make an assault rifle, and it fires countless of proyectiles in a milisec

    {
        if (Input.GetMouseButton(0))
        {
            rifle_shooting();
        }

    }```
rocky canyon
acoustic belfry
#

so, what script i have to put above rifle_shooting();?

acoustic belfry
acoustic belfry
rocky canyon
#

a simple timer would look something like

public float fireRate = 0.1f;
private float nextFireTime = 0f;

void Update()
{
    if (Input.GetMouseButton(0) && Time.time >= nextFireTime)
    {
        nextFireTime = Time.time + fireRate;
        rifle_shooting();
    }
}``` you'll need to track the `nextFireTime` in the update loop for example
#

for using a coroutine its something along the lines of..

void Update()
{
    if (Input.GetMouseButton(0) && !isFiring)
        StartCoroutine(FireCoroutine());
}

IEnumerator FireCoroutine()
{
    isFiring = true;
    rifle_shooting();
    yield return new WaitForSeconds(fireRate);
    isFiring = false;
}```
#

but i suggest u see my [previous comment](#💻┃code-beginner message) and take the time to read up on the documentation, and the other site i sent to learn what they are and how they work (or rather when to use them)

acoustic belfry
#

ok

#

well

#

thanks :3

rocky canyon
#

try out each.. see what works for you,
if u need additional help afterwards w/ specifics or issues feel free to ask

#

you'll need some additional using statements:
using System.Collections;
when using Coroutines

gloomy cosmos
#

Did a bunch of testing with my threading system (in build), these are the results:
6 threads, no transforms:
100 fps
1 thread, no transforms:
120 fps
no multithread, no transforms:
110 fps

I dont even know how to understand this

night mural
gloomy cosmos
#

well im trying to understand how 1 thread does better than no multithreading at all

#

like it makes no sense

#

the main thread waits for that one thread to finish every frame

night mural
#

right, it's not magic. If you have sequential dependencies, those still exist

rocky canyon
#

wait what? isn't (1) thread and no multi-threading the same thing?

night mural
#

especially in unity where a lot of the importnat work must be on the main thread

rocky canyon
#

as someone that doesn't use threads.. just basing it off semantics

gloomy cosmos
#

ok I think I am losing my mind

#

1 / Time.unscaledDeltaTime should be the fps, correct?

kindred cedar
#

I am relatively new to unity and c# and was wondering if anyone could help me get my collisions to work

tawdry quest
#

but 1.0f / Time.unscaledDeltaTime should also work

gloomy cosmos
#

interesting

verbal dome
#

unscaled is correct

verbal dome
gloomy cosmos
#

no multithread means it runs on the main thread, 1 thread means it creates one job and waits for it to finish

#

anyway after using deltaTime instead of unscaled the numbers changed quite drastically

rocky canyon
#

i guess u could think of it like this then..

🧑‍🍳 Imagine a bakery with:

  • 1 baker
  • several assistants

if the bakery has just enough orders for 1 baker to handle efficiently adding more asistants wont help. thy'll just get into each others way..
worse the baker has to:

  • spend time managing the assistants (overhead)
  • and waiting for assistants to finish tasks that they might not have needed to do

sometimes its better to let the baker work alone.

  • use multithreading like if the baker had to handle a large catering order. In this case, having assistants (threads) to manage different tasks, like baking and decorating, would allow the baker to focus on other things while others work in parallel.
  • use none when theres more of a costs/savings thing if chef has to wait for a cake to bake in the oven or the baker wait for it to be decorated before it’s sent out.. they'd equally be standing around
gloomy cosmos
#

maybe something else was wrong and I accidentally fixed

#

anyway it seems to make more sense now, fps becomes better with more threads

verbal dome
gloomy cosmos
rocky canyon
gloomy cosmos
#

frames per second, in my singleplayer game testing with multiple jobs is probably better to say than threads

rigid tiger
tawdry quest
#

You cant just throw any code in there either

#

it needs to make sense to run it simulatnous

gloomy cosmos
tawdry quest
#

vector multiplication ?

verbal dome
#

Wasn't it the moving transforms part?

tawdry quest
#

what are you doing that a vector multiplication eats 20% if a frame

gloomy cosmos
#

but for testing I disabled it

gloomy cosmos
tawdry quest
#

oh yeah

#

thats defo something you should multithread

gloomy cosmos
#

well I think things are finally starting to work, multithreading seems to have taken me from 42 -> 150 fps

#

which if thats really true is amazing

#

this is without updating transforms though

rigid tiger
#

Is the collission checking on your bullets or on the characters?
Having 10k objectives constantly checking collissions would slow it down

gloomy cosmos
rigid tiger
#

Oh, this test is just about making them move then

gloomy cosmos
#

yeah

#

and to avoid fps annihilation i was gonna make my own data driven collision system which only checks bullets near the player, as we dont care about most other interactions with bullets

rigid tiger
#

I think that would be event based collision, which unity uses by default, so don't worry on that end
It's all about finding which setting effects the things the most xD

gloomy cosmos
#

Hello

#

I measured a ton of job counts

#

and wanna see if someone can give me insight on results

#

the fps seems to oscillate like almost a sin wave,
near multiple of 6 pretty close to its max, and at non multiples of 6 lower, The highest recorded was at the first multiple of 6, 6

rigid tiger
#

I am not sure I understand the question, but I do not think there is correlation between optimization and multiples of 6 for FPS

sterile radish
#

hi, im making a doodle jump clone and translating my player whenever they touch the jetpack but it feels a bit too instant. how can i i ease it in and out like doodle jump?

https://hastebin.skyra.pw/udugeyujip.pgsql

wet lark
#

so im trying to create like an Action Bar that allows items and skills, i want to make it similar to how in farming games the item on the action bar decrease while also having the same in the inventory. A simple idea of what i did is basically the following UML. Is there anything else i should consider. I am currently only focusing on single player so my assumption is SO is not ideal for a inventory System in a multithreaded environment.

viral schooner
#

could someone help me with this the codes not working im a begginer

#

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

public class playermovement : MonoBehaviour
{
public float speed;
public float jump;

private float Move;

public RigidBody2D rb;

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

// Update is called once per frame
void Update()
{
    Move = Input .GetAxis("Horizontal");

    rb.velocity = new Vector2(speed * Move, rb.velocity.y)
}

}

wintry quarry
viral schooner
#

OK

#

im trying to make a 2d movement controller for unity and ive been making this for like 2 hours but every tim i go back to unity it says error cs1002; expected do you have any ideas what i did wrong like did i not capitalyze smthing?

#

this is the code

rigid tiger
viral schooner
#

you put semicolons after ) ?

wintry quarry
wintry quarry
viral schooner
#

oh

#

thx

wintry quarry
#

Is it showing you red squiggles under your errors like that

viral schooner
#

whats cofigured?

wintry quarry
#

Showing errors

#

and autocompleting

viral schooner
#

umm no

wintry quarry
#

Then you need to stop everything and get that sorted out first

#

!ide

eternal falconBOT
wintry quarry
#

Trying to write code without that is a fool's errand.

viral schooner
#

thysm

rigid tiger
pallid kite
#

Hey, I'm currently having an issue where my prefab that has a worldspace overlay of a text input field not taking any input even when I click it. This doesn't seem to be too common of an issue, but I've been stuck on it for the past couple hours on how to fix it. Can someone help me possibly debug this issue?

dry geyser
#

anyone know why i get "Type Mismatch" in the unity inspector when i select a text mesh pro text to go to this variable?
public TextMeshProUGUI prompText;

swift crag
#

You can't reference scene objects from prefabs

#

That's the most likely cause

dry geyser
queen adder
#

idk how to fix that

cosmic charm
#

my character stops moving in random areas, she stays in the move state but the xVeocity keeps switching between moveSpeed and 0 so she doesn't move but when I change direction then it goes fine, how can I fix it?

sour cape
#

anyone know why the "step" button is ghosted out?

next flint
#

hey guys, i am trying to get my ads work in my game but i keep getting this error

Assets\Scripts\AdsManager.cs(72,45): error CS0426: The type name 'Builder' does not exist in the type 'AdRequest'

#

No one seems to know how to solve this, i ended up joinig here

sour cape
#

hmm u got a screenshot of code and ide error

next flint
#

this is the code

#

this is the error

sour cape
#

seen this?

#

argh unity6 is so jerky, need to restartedl iek 10x a day

next flint
#

oh nah! let's see

cosmic dagger
eternal falconBOT
next flint
#

whats this?

polar acorn
sour cape
#

whats what?

cosmic dagger
# next flint whats this?

Exactly what it says; use paste sites to post code or inline small code blocks correctly by formatting . . .

#

You inserted a text file (to download) instead . . .

steady flame
#

yo! i need help, i get this message out of the console:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Graphs.Edge.WakeUp () (at <a31f1ba8e689484984b8d32e3f901c80>:0)
UnityEditor.Graphs.Graph.DoWakeUpEdges (System.Collections.Generic.List1[T] inEdges, System.Collections.Generic.List1[T] ok, System.Collections.Generic.List`1[T] error, System.Boolean inEdgesUsedToBeValid) (at <a31f1ba8e689484984b8d32e3f901c80>:0)
UnityEditor.Graphs.Graph.WakeUpEdges (System.Boolean clearSlotEdges) (at <a31f1ba8e689484984b8d32e3f901c80>:0)
UnityEditor.Graphs.Graph.WakeUp (System.Boolean force) (at <a31f1ba8e689484984b8d32e3f901c80>:0)
UnityEditor.Graphs.Graph.WakeUp () (at <a31f1ba8e689484984b8d32e3f901c80>:0)
UnityEditor.Graphs.Graph.OnEnable () (at <a31f1ba8e689484984b8d32e3f901c80>:0)

what do i have to do to make it gone

slender nymph
#

that is an editor error. you can pretty much ignore it

sour cape
#

i think thats a unity bug

steady flame
#

sure?

slender nymph
#

if it bothers you then close any windows that use the graph editor like the animator or shader graph editor

sour cape
#

yeh i see it sometimes

steady flame
#

ok thanks

marsh hearth
#

anyone have a waypoints script ?

#

where an ennemi goes left-right-left.. tc

rich adder
marsh hearth
#

uhm i call it like that but basicaly a script that make an ennemi travel from a point A to B and goes back

rich adder
#

not everyone handles waypoints the same way

marsh hearth
#

i tried a script from someone online, but didnt work lol

#

trying to follow a tutorial

rich adder
marsh hearth
#

and having a 60% kb is a fking shit show for scripts

rich adder
#

huh?..I use 60 no issues with scripts

marsh hearth
#

im not having issues, i just dont know the keys combo to do the things

marsh hearth
#

they dont teach us scripts

rich adder
#

scripts/code is just a tool. The code starts in your brain

#

You have to figure out the design of what you want to accomplish, then you find which pieces code helps you do that

marsh hearth
#

yeah nvm imma just ask snuffer if he wants to make one when he get online

#

like i said, idk shit about making a game so telling me to guess things isnt helping x)

rich adder
#

I suggest you go through the pathways on unity !learn

eternal falconBOT
#

:teacher: Unity Learn ↗

Over 750 hours of free live and on-demand learning content for all levels of experience!

rich adder
#

break down each thing you need into smaller goals, start getting comfortable

marsh hearth
#

i have to give my game tmw, forget it. my ennemy is my last step

rich adder
#

yeah goodluck with that then lol. Whoever told you making a game was a "overnight" thing might have mislead you

marsh hearth
#

no one ever said that

#

dont worry

rich adder
marsh hearth
#

Ill find a way

#

Worst scenario i give my game without the ennemy moving, all good its worth 15% and i have ~98%

rich adder
#

its possible to do but if you don't understand the implementation it won't work.

#

You can store Store waypoints in an array of transforms then cycle through the array through an index that gets increased each time you reach a waypoint using Vector3.Distance, or use a timer.

#

then reaching the end of array you either cycle index back to 0 (first) or go back the other way doing --

marsh hearth
#

All good chat gpt made it for me

#

☠️

upper forge
#

WOuld anyone know why my player is bouncing for no reason.... its only happeneing in one level but the same ground and same players are being used..

Ive added debugs for the jump methods but those are not being called so its not a jump being called

Im so confused as this is only happening in one level.

keen owl
rich adder
#

this is a coding channel

steady flame
#

where should i ask my question?+

rich adder
steady flame
#

thanks

upper forge
keen owl
rich adder
# upper forge

are you sure your JUMP method isn't being called somewhere else?

queen adder
#

what would should i start with as a projekt, im just started to learn coding and know basicly nothing, but still would like a little projekt to start with. know idk if i should go into 2d first, because people said that the change from 2d to 3d is hard

keen owl
#

Or check if one of your animations have a loop enabled.

rich adder
#

the best projects are the usual simple ones, break out, flappy bird, invaders, etc.

upper forge
upper forge
sour cape
rich adder
upper forge
queen adder
rich adder
# upper forge when i put it in static it didnt bounce

ok so now you can narrow down to the fact that something is adding that velocity to your RB
Find all scripts that reference the RB and go from there,
you know it was the RB and not Transform.position otherwise static would not affect it

sour cape
upper forge
sour cape
#

or an animation?

keen owl
rich adder
upper forge
#

will check all this and report back

sour cape
#

first thing just turn all scripts on that player off

#

if it stops u know its one of them

upper forge
rich adder
#

if you are not remembering it means you're not doing it enough

#

you're not gonna learn say, how to make a raycast then use it once and expect it remember how to do it again next time..

#

you have to engrain it into your mind until its pretty much easy muscle memory almost

queen adder
#

so basicly get a code and then use it as often as possible?

rich adder
#

exactly, not just "a code" but the process you used that code for

sour cape
#

put the code into meaningul method names too, then its easy, buttechnically by reading code you should be able to see what it is trying todo

rich adder
#

the code is just the tool to achieve a solution to a certain problem

#

thats why the syntax is very much the least important part, its important to you WHY that code is being used , what problem is it solving

#

Physics.Raycast, what does it do? Makes ray that can hit colliders, what problems does it solve? Detecting Objects etc.

sour cape
#

u should be a teacher 🙂

rich adder
#

Im still a newbbb

steep rose
rich adder
#

I looked at the Unity certs, hella expensive

#

maybe one day I also have my Udemy course lmao

sour cape
#

hehe, i never seen anyone even care about certs really

#

very rarely does anyone care if u even have a masters

rich adder
#

I'm sure its a good look for places that care about papers, school

sour cape
#

yeh

#

until they hit u with a carmack level exam

rich adder
#

I'd only teach if it was a school that offered gamedev

sour cape
#

im stunned ppl get into google after taking one of their exams lol.

#

need to be a savant to understand the question.

rich adder
#

basically either almost genius with problem solving or a machine.

sour cape
#

yes exactly, being a great coder with 30 yrs experience wont cut it..

rich adder
#

yeah year is important, but showing off what problems you can solve for them is everything

sour cape
#

also i cant see a single enjoyable job at google anyway, all boring nightmares.

rich adder
#

thats most jobs now days, all machine learning and data science

keen owl
#

I think mastery in C++ demonstrates a lot of that considering you’re working with a lot of stuff more manually that .NET already handles

sour cape
#

yeh i thin ki have a test laterfor "alignnr" bet thats too hard

rich adder
#

anyway lets not veer offcourse to unity programming topics lol

upper forge
#

OMG I got it THanks to all that helped me
it was in my enemy script where i have the player jump on an enemies head and then the player jumps somehow that was trigging it

#

thanks @rich adder @keen owl @sour cape

sour cape
#

np good luck,

keen owl
#

Nice job! Make sure to look out for small mistakes like that next time as they can get annoying to deal with lol

rich adder
#

I sure hope you don't have everything Public everywhere lol

sour cape
#

i once took 2 yrs to fix a bug, and i cried when i finally did lol

upper forge
#
private void OnTriggerEnter2D(Collider2D other)
{
    if (other.CompareTag("Player") && this.gameObject.CompareTag("Slime") || this.gameObject.CompareTag("Bat"))
    {
        currentHealth--;
        if (currentHealth <= 0)
        {
        // THE LINE COMMENTED BELOW IS THE ONE CAUSING THE PLAYER TO JUMP ON START    //PlayerController.instance.theRB.velocity = new Vector2(PlayerController.instance.theRB.velocity.x, PlayerController.instance.jumpForce = 13f);
            PlayerController.instance.jumpForce = 13f;
            PlayerController.instance.anim.SetBool("isDoubleJumping", true);
            PlayerController.instance.jumpForce = 19f;
        }

    }
    else if (other.CompareTag("Player") && this.gameObject.CompareTag("Kidnapper"))
    {
        PlayerHealthController.instance.DamagePlayer();
    }
}

So this is my code for if the enemy's health is 0 then is makes the player jump is there a different way to do this..

upper forge
sour cape
#

seems alright, id prob put brackets around this.gameObject.CompareTag("Slime") || this.gameObject.CompareTag("Bat")

#

yeh then i was so happy i drank a half bottle of whisky, carried on working and somehow lost the solution lol, took another 6 months to find

#

no point in setting jumpforce twice btw

#

hardest bugs to solve for me are usually timing issues, race conditions or actual differences in timing on hardware

#

but once u fix one u are aware of the hell 🙂 this was 2 identical phones behaving different in same game.

upper forge
upper forge
sour cape
#

i remember being on my knees in the garden nailing whisky, screaming.... before backing up lol.

#

always back up before celebration 🙂

upper forge
sour cape
#

use ( )

cosmic dagger
sour cape
#

just so its IF THIS && (THIS OR THIS)

north kiln
#

It seems weird to handle it all with tags, and that the slime, bat, and kidnapper share this implementation

#

I'd make a separate script for damaging the player on hit

sour cape
#

i dont find it that weird

cosmic dagger
#

you shouldn't have to check what tag this object has. it should already be known . . .

upper forge
# cosmic dagger what are you trying to do?

but

PlayerController.instance.theRB.velocity = new Vector2(PlayerController.instance.theRB.velocity.x, PlayerController.instance.jumpForce = 13f);

this line of code is whats causing this bounce for no reason

would u know why this could would do this?

Trying to figure why this line of code is making my player jump even thought the enemys health is not a 0 or the player did not go over the trigger for it to be called

north kiln
#

The value of components is that you can compose them instead of writing a monolithic implementation that switches between different logic

sour cape
#

the health must be 0, print out what health is after u do the --

#

maybe u forgot to initialise health and it starts 0 ?

upper forge
#

WAIt NVM doing this fixed it
IF THIS && (THIS OR THIS) @ @sour cape

cosmic dagger
upper forge
#

so the player dont jump as high as a normal jump
Jumpforce is the value of jump

sour cape
upper forge
cosmic dagger
#

they meant the parentheses (). they separate the logic in your expression (if statement) . . .

sour cape
#

it was saying if other one is a player and this one is a slime OR if this one is a bat

#

hard to explain, think maths style, like 5 x 10 x 10 is different from 5x (10x10)

upper forge
queen adder
#

i wrote a collision code so i can kinda push objects around. but they just dissapear instread

sour cape
#

maybe the force is so much they appear to disappear but theyre miles away

#

reduce pushPower to like 0.01f to test

queen adder
#

ok wait

queen adder
#

thanks

sour cape
#

niiice.. np

marsh hearth
#

Anyone have an idea of why it does that?

sour cape
#

looks like something turns off your camera, or the parent of it

#

check in hierarchy if its off

marsh hearth
#

When i start, my player,celling check,ground check and main camera turn grey in the hierarchy@sour cape

#

Okay i fixed it

sour cape
#

dark grey, somethings turning them off yeh, start by trying to find which script it may be, turn off likely candidates then start game again until u narrow it down

marsh hearth
#

That was weird

sour cape
#

cool

marsh hearth
#

Thx for helping

sour cape
#

np

#

anyone know a discord where u can find unity paid work?

rich adder
# marsh hearth

dont crosspost next time and this is not a coding question

sour cape
#

lol

marsh hearth
#

Ill make sure to ask in code-advanced next time

nova kite
#

How do I fix this?

#

I managed to fix some through this but now it’s grayed out

#

It’s an official Unity project btw that I imported

sour cape
#

pink is usually unsupported material due to using the wrong graphics pipeline

rich adder
sour cape
#

so you need to convert the materials to support

nova kite
#

How do I do that?

sour cape
#

which pipeline is the sample?

nova kite
#

Where do I see that?😅

sour cape
#

window->rendering->hdrp wizard is "semi" good at converting materials to HDRP

#

hehe where did u get the sample from whats the name

nova kite
#

i downloaded the "Challenge 2 starter files"

#

it also messed up some other textures on the tutorial project

sour cape
#

hmm, im assuming thats built in or urp

nova kite
#

Which option do I click here haha

#

The converter?

sour cape
#

what does inspector say about them materials

#

when u click on them

nova kite
sour cape
#

yeh i guess thats only ther ein hdrp projs

nova kite
#

What does that mean haha😅

#

I’m very new btw, only been studying for a week

sour cape
#

open the materials drop down select one of the materials

#

then click on that see what it says

rich adder
sour cape
#

yehi get it, its all confusing as heck in the beginning

nova kite
#

You mean the materials folder?

sour cape
#

doesnt help that i can barely type because every keyboard i get breaks within a week

#

in mesh renderer theres a merials dropdown

sour cape
#

if u click o na metial in there itll show more info about the merial

nova kite
#

Is it a Razer keyboard

sour cape
#

or maybe just scrollright now on that inspector

#

no razor have done tho,

nova kite
sour cape
#

i break spacebars for a living

nova kite
#

Hahaha

sour cape
#

haha yeh, i got 7 here

rich adder
nova kite
#

I have a BlackWidow v4 and it has a double clicking issue it’s the third already

sour cape
#

its like being in a tanning salon just using pc

nova kite
sour cape
#

basically the material u need to change the "shader" to compatible one

rich adder
nova kite
#

Ohh I see the shader component

#

Fair enough

sour cape
#

yeh whats it say under shader

nova kite
#

what option should i select here?

rich adder
#

the pink one

sour cape
#

ah ok theyre URP and u must be on BIRP,

marsh hearth
nova kite
#

I mean at the bottom right after I opened the shader list lol

sour cape
#

so u can either convert them to BIRP or move to URP

nova kite
#

How do I do that haha🥲

sour cape
#

id just change it "standard"

#

in that little search thingy type "standard"

rich adder
#

those are BIRP material they are using URP already

#

use the Pipeline converter

sour cape
#

yeh or use the pipeline converter

nova kite
#

its on standard but nothing changed

sour cape
#

oh yeh ur right the green works and is URP

nova kite
#

the red ball got fixed for some reason lol

rich adder
#

cause Standard is wrong

nova kite
#

even tho i didnt pick it

rich adder
#

Standard = BIRP

nova kite
#

ohh

rich adder
#

Rendering -> Pipeline Converter

sour cape
#

so type "universal" and select a universal renmder pipeline/lit one

#

or do that ^^^^

nova kite
rich adder
#

its usually better to convert

sour cape
#

unity haveconfused the whole situ with all this

nova kite
#

what do i do here?

rich adder
sour cape
#

tick material upgrade his convert assets

#

yeh tick em all

nova kite
#

Let’s gooo that worked!!

#

Thank you guys🙏🏻🙏🏻

sour cape
#

yessss

#

np

nova kite
#

Let’s see if I can get the challenge done now🤣

rich adder
nova kite
#

It’s fun they give you a game with many bugs and you gotta fix them

sour cape
#

sounds like my last job 🙂

nova kite
#

Oh I thought this is the channel for beginners

nova kite
rich adder
#

code-beginner

nova kite
#

I love finding problems and find solutions

rich adder
#

then coding is for you

nova kite
# rich adder **code**-beginner

Well yeah but people treat people here like beginners and I need someone to explain like I’m 5 to me when it comes to this😭😭

rich adder
nova kite
#

Ohh I thought that’s like for people who already know Unity lol

rich adder
#

nahh read description

nova kite
#

Sweet, I’ll ask there when it’s not code related then

#

Ohh!

#

It’s like the general channel

rich adder
#

yea

nova kite
#

Thank you😄

sand moss
#

Hi. I have stumbled upon a problem regarding in app updates.

    {
        // Wait a brief moment to let the scene fully load
        yield return new WaitForSeconds(0.5f);
        
        InAppStatus.text = "Checking for updates...";
        
        PlayAsyncOperation<AppUpdateInfo, AppUpdateErrorCode> appUpdateInfoOperation = appUpdateManager.GetAppUpdateInfo();
        yield return appUpdateInfoOperation;

        if (!appUpdateInfoOperation.IsSuccessful)
        {
            string errorMessage = $"Update check failed: {appUpdateInfoOperation.Error}";
            Debug.LogError(errorMessage);
            InAppStatus.text = errorMessage;
            updateCheckComplete = true;
            yield break;
        }

        var appUpdateInfoResult = appUpdateInfoOperation.GetResult();
        
        if (appUpdateInfoResult.UpdateAvailability == UpdateAvailability.UpdateAvailable 
            && appUpdateInfoResult.IsUpdateTypeAllowed(AppUpdateOptions.ImmediateAppUpdateOptions()))
        {
            InAppStatus.text = "Starting update...";
            StartCoroutine(StartImmediateUpdate(appUpdateInfoResult));
        }
        else
        {
            InAppStatus.text = "No update available";
            updateCheckComplete = true;
        }
    }```
this is my code.  
The code stops at Play async operation for unknown reason. can someone guide me regarding this issue.
prime goblet
#

is there anything in the console?

sand moss
#

No. The console is not showing anything. The app works fine. just this script stops at this point

burnt vapor
#

Also, does your code hang the application or does it just not continue when you say it stops?

#

Also, how did you determine this is the issue? Can you confirm by logging before appUpdateManager.GetAppUpdateInfo() and after to see if truly only 1 log is printed?

sand moss
#

It checks if new version is available for you app and returns information about available update.
The app doesnot hang it works fine. I am showing status of this process on my screen. InAppStatus.text = "Checking for updates..."; The screen shows this status. In the code provided above I am updating this status in multiple instances but it just stops there.

burnt vapor
#

Also, I still don't see what appUpdateManager.GetAppUpdateInfo() is. Is this user code?

#

If it hangs on appUpdateManager.GetAppUpdateInfo() and it's not user code, there's not much you can do. At best I'd check if it ends up timing out, or if you can somehow make it time out. If that's the case your credentials are wrong

sand moss
teal viper
gilded canyon
#

how do i set angle limits for a hinge joint 2d . there is very little documentation for it anyways heres my snippet

#

vent = collision.gameObject.GetComponentInParent<HingeJoint2D>();
JointAngleLimits2D limits = vent.limits;
limits.max = 0;
limits.min=90;

teal viper
#

if JointAngleLimits2D is a struct, you need to assign the limits back to vent again.

gilded canyon
#

i complely forgot

#

thanks

sand moss
#
 
        InAppStatus.text = "Checking for updates...";
        PlayAsyncOperation<AppUpdateInfo, AppUpdateErrorCode> appUpdateInfoOperation = appUpdateManager.GetAppUpdateInfo();
        InAppStatus.text = "After PlayAsyncOperation...";
        
        yield return appUpdateInfoOperation;

        InAppStatus.text = "After Yield reuturn...";

it is logging like this

burnt vapor
#

That's weird, I would expect it to stop at the yield

#

So After PlayAsyncOperation... would be displayed

#

The yield would explicitly drop the coroutine until it's finished. If it stops at GetAppUpdateInfo as soon as it's called I would expect it to block the application

eager spindle
#

Is it stuck in getupdateinfo?

#

If you're running this on an android device(not unity's emulator) try to run the debugger there

#

Some errors only show when tested natively instead of unity editor

sand moss
rich egret
eager spindle
#

There's a chance that getappupdateinfo is throwing smth but unity doesnt catch it or doesn't respond

sand moss
eager spindle
# rich egret How to fix this UI problem?

ah the art of scalable UI

Different screens have different sizes, the position of some elements may be different. See how to build UI menus to counter this change:
https://youtu.be/QnT-2KxVvyk?si=fnhl-LXqi9rD4OGl

Master Unity UI! Start here ➡️ https://cococode.net/courses/master-unity-ui?utm_source=youtube&utm_medium=video&utm_campaign=5

This tutorial/guide will show you how to resize your Unity UI canvas, GameObjects, text, button and images. You will learn:

  • How to fix Unity UI for every resolution
  • How to adapt UI for mobile devices
  • How to change...
▶ Play video
teal viper
burnt vapor
#

Also, absolutely no clue what problem you are indicating

rich egret
eager spindle
eager spindle
#

I'm only seeing results for android studio

sand moss
eager spindle
#

erm

#

is this package from unity package installer? googles website?

#

could you link the documentation? all the results are for android studio in java which doesn't exactly help here

rich egret
eager spindle
#

resize your editor window

#

what happens?

#

like try dragging the border around

#

look at how your chat box moves

teal viper
sand moss
teal viper
#

The best I can think of is that it doesn't work in the editor.
Aside from that maybe google similar issues.

sand moss
rich egret
#

@eager spindle nvm i fixed it

#

i forgot to add content size filter

sand moss
teal viper
burnt vapor
#

Many things can stop a connection

teal viper
#

It seems to be calling into a java api internally, so I wouldn't be surprised that it doesn't work in the editor.

frail wind
#

what does Is Kinematic in Rigdbody mean?

timber tide
valid vector
#

my navmesh isnt moving my object

eternal sierra
#

Can some expain how slerp works pls

jolly stone
#

is it fine if i use python for unity?

frosty hound
#

Unity uses C#

jolly stone
#

Okay

thorn tree
#

hloo

thorn tree
frosty hound
cosmic dagger
# eternal sierra Can some expain how slerp works pls

Lerp interpolates (moves along the shortest path) from a to b in a straight line

Slerp interpolates (moves along the shortest path) from a to b on a sphere

It uses directions instead of a point in space. Imagine picking two cities on a globe. Your finger will move in an arc (spherically) around the globe between both points. That's how it will move

In Unity, the interpolation (movement along the shortest path) is based on the angle between both directions, therefore, noting it rotates from one direction to another

Basically, imagine moving your head from left-to-right; that's sleeping . . .

thorn tree
#

can i send tutorial links here?

cosmic dagger
thorn tree
cosmic dagger
#

If to help, or show what you need help on, sure . . .

thorn tree
#

thanks

cosmic dagger
#

Well, as this is a coding channel. You need to find the proper channel for that . . .

#

You'll find better help in one that is suited for level design than us keyboard warriors . . .

thorn tree
cosmic dagger
#

Oh, I wouldn't know. I only code; not design or build levels . . .