#šŸ’»ā”ƒcode-beginner

1 messages Ā· Page 347 of 1

hasty sleet
#

Prioritize setting up your workflow using git from the command line. It will save you tons of headache down the line

#

That's definitely a power user perspective. Windows is mainly used for corporations and casual users so it's kind of bulky via indifference, I think

hushed hinge
#

i mean should i commit all the files?

hasty sleet
languid spire
topaz arrow
#

while i wait for an answer in another channel , anyone here need help?

eternal needle
lofty star
#

So I have implemented a floating joystick from unity asset store. Now I'm having a bug where when I touch the screen for the first time the joystick doesn't move but the player moves to the bottom left direction, only when I lift my finger and press it again then the joystick works normally. How do I fix this?

hushed hinge
eternal needle
#

once you've pushed it, it will be visible on github

spiral pewter
#

I have started learning C# for Unity and try to do some with my experiance. But the Code doasn't work...
The Consol displays no errors.

Can anyone help me?

burnt vapor
eternal falconBOT
languid spire
outer scarab
#

Also debugging is handled via attaching VS to the Unity Editor. (If you want to do it via VS, otherwise you can use Unity debugging in play mode)

#

Since there is no error in his code, nothing would be found.

slender nymph
#

that's vs code, not visual studio. and it isn't actually configured

spiral pewter
eternal needle
#

It's just a general rule that you must have it configured to get help in here. The actual issue is what Steve pointed out

spiral pewter
#

And I have tryed it as Update

slender nymph
#

and you've clearly not progressed far enough in the unity course you are doing that you actually have any clue what you should be doing here

teal viper
#

Or are you asking ai to write the code for you?

spiral pewter
#

And the Extantion from VS Code is installed

spiral pewter
spiral pewter
#

But Thanks^^

outer scarab
#

Update() doesn't accept parameters.

icy sluice
#

hello, i cant hit a raycast at the backface of non convex collider

teal viper
#

We know that. You don't need to report it to us.

icy sluice
#

but i need to hit a backface

icy sluice
#

it doesnt, i tried

verbal dome
#

So does that only work for convex? The doc should mention it then šŸ¤”

void thicket
teal viper
teal viper
icy sluice
#

my mesh has couple of thousand vertices, and i need those for accurate armor protection/balistics, but the raycast doesnt work on backfaces so i cant get the thickness of the armor its trying to penetrate

teal viper
# icy sluice yes

Well, you can't hit colliders if your raycast originates inside them.

icy sluice
#

than how am i suposed to hit a backface?

#

i cant hit it from the outside

void thicket
#

Non convex collider?

#

Concave mesh colliders have many limitations

teal viper
#

I'd assume it's for "plane" like colliders where the back face is exposed. Not sure.

#

Or just meshes that have their faces inverted.

void thicket
#

Well maybe post image of your mesh to show what it looks like

verbal dome
#

Yeah I just confirmed, queriesHitBackfaces only works for convex

#

@icy sluice Either use multiple convex colliders or just primitive colliders (box, sphere, capsule)

verbal dome
#

Wat

#

Oh when you raycast from inside it?

#

True

icy sluice
#

i move the hit.point 0.001 inside, and shoot another raycast

#

to get the thickness

verbal dome
icy sluice
#

but i dont know how thick the object is, and there are multiple components very close together

#

so i might get the value that armor is 5meters thick but in reality its 45mm

teal viper
#

Why can't you define thickness as a number in code?

verbal dome
#

Because it depends on the angle, for one

icy sluice
#

nope, i can make a triangle, if the top triangle is thinner than bottom part it should penetrate the top part but not the bottom part, due its thicker

verbal dome
teal viper
verbal dome
teal viper
#

I mean, you can check the hit triangle

#

It seems better than making several colliders and raycast hacks to decide thickness.

#

You could even have a texture that specifically defines the thickness of the mesh triangles.

verbal dome
#

Doesn't need several colliders and calling it a hack is a bit of a stretch

#

Having a texture for everything seems like an awful lot of work

#

Wouldn't it be nice to just rely on the colliders the objects already have?

teal viper
#

One per mesh

teal viper
verbal dome
#

Idk about detail, but hollow is preferred yes

#

For solid objects, I use this for my projectile/ballistics calculations

#

For 'hollow' objects (say, a wooden crate) I pre-define a uniform thickness like you also suggested

#

To be clear, this is how the dual raycast works

#

Just need to make sure that the 2nd ray starts outside the collider

untold hull
#

What keeps you guys motivated? I play this mobile game that is really fun, but super p2w and the devs kinda suck, and It’s been really stuck in my head to make a game similar, but make it better and actually implement the community feedback and things that they’ve been ignoring. I’ve been messing around in Unity but as soon as I get stuck or something doesn’t work I give up lol.

This task seems relatively easy, as it’s a simple castle defense game, but coming from no coding experience it’s giving me a headache. Give me some motivation please šŸ™

languid spire
frosty hound
#

Nobody can give you motivation. And if you think motivation will drive you to spend a year making something, you're already destined to fail. Motivation waivers.

#

What you're looking for is to stay disciplined. Nobody can teach you that either, that's something you need to develop.

untold hull
languid spire
untold hull
#

Oh I’m sure, I just meant in comparison, it is not the hardest task in the book.

Just looking for some tips and advice like that to keep me going on this crusade. Feel like this project has some potential based on the community I’ve been talking with. Just need to keep my nose in this coding world to make it happen

languid spire
#

if this is your first foray into game dev then don't do this project. Start small, pong, flappy bird, etc and build up your knowledge and skill level first

woven pewter
#

Start as big as it’s possible

#

Ive done that too

untold hull
#

Ignoring all the extra stuff, I’ve been keeping at the basics of just movement and collisions and stuff like that

languid spire
untold hull
#

Well you just said to start with a basic flappy bird game, and this is one of those ā€œbasicā€ games lol. I’m very positive there is more under the hood, but the basis of the game is a ā€œbasic flappy birdā€ game

woven pewter
untold hull
#

So are you saying a basic flappy bird game also has everything under the hood and I shouldn’t even start with that? I’m confused

untold hull
woven pewter
deft grail
languid spire
untold hull
#

Yeah, but I said that this game is almost the exact same thing as the basic flappy bird game, if you exclude the extra stuff, and he’s combatting it

languid spire
#

no, you only think it is, it is not

deft grail
languid spire
#

and then there is the whole NPC AI mechanisms

deft grail
languid spire
woven pewter
languid spire
#

no

untold hull
#

I mean if you’re talking monster walk in a straight line to base, monster hit base, base take damage, I have half of it coded already, just confused where the complexity comes in. Like obviously this is more complex than riding a bike, but the game is pretty ā€œsimpleā€, doodled graphics, monsters walk in a straight line, very little animations

woven pewter
#

U crazy?

languid spire
#

why would I Lua is a language for amateurs

green ether
#

i was gonna say

#

why use lua

deft grail
untold hull
deft grail
#

if your recreating a game then it should be pretty easy for you to know the next steps

untold hull
#

Yeah for sure, I just never know chronologically, but I guess that doesn’t really matter. I still have a good bit I need to do to make the game actually running, but nothing so far that has made me shake my head.

deft grail
#

you can almost always start with something else and do something else next

languid spire
deft grail
#

it might not make sense, but you can do what you want

untold hull
#

Gotcha, I try to go as they come, like I get the monster there, okay now the monster has to move, okay monster hits where it needs to go, okay now it needs to attack, okay now it needs damage. etc. I’m sure there’s some more efficient ways I’ll learn in due time, but the chronological process seems to keep me in line

green ether
#

Its a very nice way to learn if you learn the basics like this and then restart on a fresh project and improve it

languid spire
green ether
#

I recently restarted my game on a fresh project, it wasnt terrible to begin with, but I learned so many new things about how to structure my project, code and everything else that I can do it much better now

#

Its very satisfying

#

I made alot of mistakes the first time around but realized them at some point and ept going till I realized enough mistakes that warranted me wanting to start over

#

And now I notice less and less mistakes as I work, especially ones that would require me to do a whole restart of the project

untold hull
#

Yeah i’m looking forward to when I get to that point. I’m sure this project will have to be remade a million times before it’s even remotely passable as a game

green ether
#

Dont restart often if you dont absolutely have to, continue no matter what to get it playable at least, fix what you can without rewriting the whole thing

languid spire
#

That is the beauty of a GDD, it allows you to identify which are the core elements of your project and then you can build from there

untold hull
#

I think a big thing for me right now is as i’m doing stuff I try to bite off more than I can chew, get stressed, then walk away for the day, but luckily I keep waking up in the morning wanting to continue working on it. Just gotta keep it simple

untold hull
ivory bobcat
#

Set a task that you can finish within a timely manner

languid spire
ivory bobcat
#

If you cannot finish said task, take it a notch lower until you find yourself completing your tasks (games in this case) and are wanting more challenges.

ivory bobcat
molten dock
#

i think my first game will be overwatch 3

languid spire
untold hull
#

Is Nuclino a good GDD website? Is there any information on them in the discord?

ionic plank
#

Hi guys, do you know some tutorials where I can learn about making AI for unity (an android platformer game) ? (collecting game data [deaths and time to complete a level ] and feeding it into an AI to generate the next level with a procedural generation algorithm )

kindred halo
#

            float mouseX = Input.GetAxis("Mouse X") *                  mouseSensitivity * Time.deltaTime;
            mouseY = Input.GetAxis("Mouse Y") *                        mouseSensitivity * Time.deltaTime;
            yRotation -= mouseX;
            xRotation -= mouseY;
            yRotation = Mathf.Clamp(yRotation, -90f, 90f);
            xRotation = Mathf.Clamp(xRotation, -60f, 90f);
            transform.localRotation = Quaternion.Euler(xRotation, yRotation, 0f);```
can you guys tell what's wrong here?
for some reason the rotation is inverted in the y angle.
wintry quarry
#

For two, that's just a consequence of how "up and down" in screen space are defined

#

Just invert it with a -

rich adder
kindred halo
hushed hinge
rich adder
#

did you commit the .gitignore file ?

hushed hinge
rich adder
hushed hinge
rich adder
hushed hinge
#

oh that one, it's nothing

rich adder
#

scroll down in the stage 1-1 after all the Assets folder. Do you have stuff from /Library in there too @hushed hinge

hushed hinge
rich adder
hushed hinge
rich adder
#

you need it

burnt vapor
#

Judging by the tiny scrollbar I'm guessing they did in fact not have a gitignore

hushed hinge
rich adder
#

fuckin-finally

#

ok so you're good to go..

#

just make sure you make a commit every time you want to preserve a "state" of your project as it is

#

jus be aware.
A scene will only detect its changed if you did save and don't have * on it btw

#

btw you could probably add the .DS_Store in . gitignore (right click add to gitignore)

#

thats like a macos file only. Its already being tracked though so that might be a pain to now add it to gitignore file type

hushed hinge
rich adder
hushed hinge
#

ok, but how does that help me with changing the stage 1-1 scene back to how it was before a lot of things were deleted and added?

rich adder
#

obviously you don't want to be only committing major changes, you should also be committing small changes too

#

but also you don't need to revert ALL the files, just the one or two you may be interested in

#

eg a scene file

hushed hinge
hushed hinge
green ether
#

you can rightclick any commit in the History tab on the left to revert it

#

Or start a branch starting from a specific commit

hushed hinge
hushed hinge
rich adder
#

you can replace individual files I said from another commit

#

just be aware this won't restore any files you haven't made commit on

hushed hinge
rich adder
#

the CLI can let you do it with a few commands, manually easiest you would have to download the whole ZIP of previous commit, and cherry pick and replace like that

hushed hinge
#

how do i do that?

rich adder
rich adder
#

just be careful not to bork the whole thing

hushed hinge
#

i did click on view on github, but it takes me to a website, and when i tried to sign in "even though it is my password", I guess i will have to wait......... man i really want it back so badly....

rich adder
#

everything you did inside after Initial commit will be gone, might have to replace the .meta file that goes with it too I think.

hushed hinge
#

......... sigh... i guess I will be restarting the building in the first stage 1-1 from the beginning... lik rebuilding for the beginners to play on the first one

hushed hinge
#

time to restart from the begnning in making the first stage

rich adder
hushed hinge
#

yeah

abstract finch
#

Is there a way to get the simulated rotation of something? What I'm trying to do is:

Apply recoil to the camera tilting it up. However, I do not want the camera to go past a certain extent in this case 90.

So I want to calculate how much recoil can be applied to the camera before doing so.

For example, if the recoil is 5 and the camera pitch is at 89. I only want to apply 1 recoil. Is there a way to get this value?

is it simply _simulatedRecoilY = transform.rotation.x + _currentRecoil?

wintry quarry
rain brook
wintry quarry
abstract finch
abstract finch
#

Unforunately its not giving me the number I need ill do some goolging

#

I'm basically trying to apply recoil but have it stop at a certain pitch, the guides that I've found dont take clamp into account

wintry quarry
abstract finch
#

What I think I need is the value of the current pitch of the camera. I'm mainly using this to see how close it is to 90

rain brook
#

rotation = Mathf.Clamp(minrotation, maxrotation currentRotation +recoil)

abstract finch
wintry quarry
#

at 90 your object will be facing directly down

#

so the difference between that and up is 180

#

at -90 it will be facing directly up

#

which is... directly up, exactly matching world up, with a difference of 0

abstract finch
#

ah i see now i think i can use this

#

I just have to do -90 and it reflects what I see in the inspector

buoyant schooner
#

Is multiplayer possible with just unity actions? or would it be easier to hook up multiplayer using actions & player input component ?

#

using the unity input system

green ether
#

What

brave compass
buoyant schooner
#

non split screen, through something like steam

#

on a server

molten dock
#

how would i make music fade in and out based on which area of the map im in, within the same scene btw

brave compass
austere hearth
#

3d sound @molten dock

buoyant schooner
#

okay

#

thx šŸ™‚

molten dock
#

when the sound is 3D

#

oh i see thank you

#

that is cool

austere hearth
#

if you add the sound in hierarchy and select that, will see the 3D option in inspector

brave compass
#

You're limited to just a spherical shape with 3D sound, though.

austere hearth
#

can be adjusted

#

sound is spherical true

brave compass
#

The falloff curve, yes, but it's still a sphere.

austere hearth
#

like in real live

molten dock
#

thats a good feature to know about

fervent iron
#

is it the general consensus that I should be practicing using JSON instead of Scriptable Objects to store readable data?

brave compass
# austere hearth like in real live

Real life doesn't have a music track like video games. There are cases where you may want a certain track to start playing when you enter a room. Not necessarily because there's a speaker in the room, just in the background.

austere hearth
#

can use PlayerPreff as well for saving data

molten dock
#

i would also need something more sudden for like

#

themetunes of areas and stuff

austere hearth
#

3D is used for sounds effects

#

for bg sound no need

swift crag
#

(either or)

#

ScriptableObjects are useful because you can directly reference SO assets

fervent iron
molten dock
#

i think i know how to play a song when i reach a collider

#

confused how i would have it fade out and in

swift crag
#

for example, I have a SO asset for each person in my credits list

#

i just drag them into the appropriate categories

molten dock
austere hearth
#

if want fade in fade out can be coded

fervent iron
warm moat
#

The above model I downloaded from grab cad hence I want to write the script for conveyor movement in unity.
Can any one help?

timber tide
fervent iron
swift crag
timber tide
#
namespace Weapons
{
  [Serializable]
  public class WeaponData
  {
    [field: SerializeField] public string id {get; private set;} //guid requires some OnValidate/OnSerialization method
    [field: SerializeField] public float Damage {get; private set;}
    [field: SerializeField] public float AttackSpeed {get; private set;}
  }
  
  public class WeaponManager
  {
    [field: SerializeField] public List<WeaponData> WeaponDatas {get; private set;}
  }
}```
**better idea
fervent iron
#

ty

swift crag
#

as in, serialized references you set in the inspector

swift crag
#

you'll be referencing things by name (like public string weaponDataID on a weapon prefab) or not caring about specific references at all

#

like in a drop table: you just need the whole table

#

(although, how does the drop table know what items to give you?)

#

it'd have to use item names

#

That is one big problem with storing your data in something that isn't serialized by Unity: you have to figure out how to store references yourself

#

if you rename a weapon in one blob of JSON, you need to go fix the names in all of the other blobs

#

using GUIDs (or some other ID) can help with this

fervent iron
#

I see

#

I am trying to find the balance of what should be done in unity, and what in script, when there is the options. I am finding some different opinions out there. I recall reading one commentary a bit ago that went as far as "I find the best way to use Unity is to not use unity" implying that if it can be scripted then it should be scripted

timber tide
#

you can do a lot without Mono/SOs, but if you want reusability then you start using Unity's stuff

#

as far as working in the editor goes

untold hull
#

I've been trying to figure this out and look it up, but I cant quite get it... I have a monster spawner thats spawning monsters and they weren't appearing on the game scene, but they were appearing on the editor scene. The projectiles are still being shot at them and killing them... I think I traced it down to an issue with the projectiles/monsters acting in 3d rather than the supposed 2D, ie the picture. I've checked all the layers and they're all set to default (the same one). Is this going to be an issue in my code? Thanks in advance, I'm sure its a simple fix somewhere, but am lost

deft grail
#

check the Z layer on the projectile and make sure its 0 or above

untold hull
#

wdym

#

The ones on the scene are negative Z, which is not what I want

#

(I think)

deft grail
untold hull
#

Yeah, so I have it so they just follow the monsters in a certain radius. I think the issue is stemming from the monsters spawning not on the same XY plane?

deft grail
#

or wait ist he white the projectile and red the monster?

#

i thought red is the projectile

untold hull
#

I'm an idiot I figured it out by typing... The monster spawner was set to Z: -9 and I just set it to z:0 instead lol

#

Yeah sorry red is monster white is projectile

untold hull
#

Yeah I didn't realize you thought projectile was red so when I checked projectile (being white) it didn't matter the Z axis

#

but that sparked checking the actual one which was the one you meant lol

#

simple fix though thank you

hallow totem
#

So I've installed VS code and the Unity extension and also the Visual Stuido Editor in unity but VS code doesn't show up here.

honest haven
#
    {
        SceneManager.sceneLoaded += OnSceneLoaded;
    }

    private void OnDisable()
    {
        SceneManager.sceneLoaded -= OnSceneLoaded;
    }

    private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
    {
        if (winBattle)
        {
            winBattle = false;
            StaticBattleEnemys.enemy.SetActive(false);
            Instantiate(StaticBattleEnemys.rewardItem, StaticBattleEnemys.rewardItemPosition);
            PlayerController.instance.gameObject.SetActive(true);
            CheckCameraTargets.instance.gameObject.SetActive(true);
            InventoryMenu.instance.gameObject.SetActive(true);
            CraftingManager.instance.gameObject.SetActive(true);
            InventorySlots.instance.gameObject.SetActive(true);
            RewardsUI.instance.gameObject.SetActive(true);
            PlayerController.instance.transform.position = StaticBattleEnemys.playerPosition.transform.position;
        }
    }``` is onEnable called before awake?
tired otter
#

Anyone else having trouble checking the lessons on Unity Learn?

dusty shell
#

Could anyone link a good video to learn touch input for mobile?

#

I'm begging, I understand nothing

hushed hinge
#

what does this mean?

polar acorn
hushed hinge
polar acorn
hushed hinge
#

but i don't know what it is then...

polar acorn
#

You know what script it is

#

Look at what it's calling DontDestroyOnLoad on

polar acorn
#

Show !code and say what your issues are with your attempts

eternal falconBOT
polar acorn
#

and either make it one, or don't try to DDOL it

#

Then how do you know the tutorials don't work

#

So show what you attempted and explain what isn't working

#

Then try again, we can't really do anything with zero information

hushed hinge
polar acorn
#

since you know what scene it happens in

#

and you know what script does it

#

what more information do you need

hushed hinge
polar acorn
hollow dawn
#

I need help. When I press w the player walks and the walking forward animation plays but when pressing s the walking backward animation doesn't play how can I fix this?

polar acorn
hollow dawn
polar acorn
#

That isn't what I asked for

rich adder
#

imo just use a blend tree

hushed hinge
polar acorn
polar acorn
# hollow dawn

Okay, now show !code where you set the speed variable when moving backwards

eternal falconBOT
rich adder
hushed hinge
polar acorn
polar acorn
hollow dawn
#

how do you check the velocity?

rich adder
#

check animator

#

or use a Log

hollow dawn
#

-4

polar acorn
hollow dawn
polar acorn
hollow dawn
rich adder
#

but your condition to WalkB is "larger than 0.1" that makes no sense

polar acorn
# hushed hinge

These are two different scenes, and the object is only selected in one of them, and that one isn't the one the error occurs in. You should actually try reading what I asked for

hollow dawn
polar acorn
rich adder
polar acorn
#

What is the speed value you are expecting to be at when walking backwards

hollow dawn
hushed hinge
#

ok

rich adder
hollow dawn
rich adder
#

so you're just gonna do random shit and hope for the best or what?

#

rethink the logic of your transitions

#

what is the speed when you want IDLE -> WALKB

polar acorn
# hollow dawn to both of them

Think about when you want the animation to start, and when you want the animation to end. Whenever those conditions are met, it'll change animations

#

So, when do you want to start the WalkB animation?

hollow dawn
rich adder
hallow totem
#

Okay so I configured my IDE but I still can't get the damage script to work, the original one didn't show any issues in the configured IDE either, I've also tried this but the damage still isn't being delt, any ideas as to why that might be?

using System.Collections.Generic;
using UnityEngine;

public class Damage : MonoBehaviour
{
    public int damageAmount;
    float cooldown = 0f;
    private void Update()
    {
        Debug.Log(cooldown);
        cooldown -= Time.deltaTime;
    }
    private void OnCollisionStay (Collision collision)
    {
        Player player = collision.gameObject.GetComponent<Player>();
        if (cooldown <=0)
        {
            player.TakeDamage(damageAmount);
        }
        cooldown = 1f;
    }
}
    
using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

public class Player : MonoBehaviour
{
    public int player = 100;
    public void TakeDamage (int damageAmount)
    {
        player -= damageAmount;
        
        if (player <= 0)
        {
            PlayerDead();
            print ("is dead");
        }
        
    }
    private void PlayerDead()
    {
        GetComponent<MouseMovement>().enabled = false;
        GetComponent<PlayerMovement>().enabled = false;
    }
}
polar acorn
polar acorn
rich adder
#

are the logs printing

hallow totem
#

These are.

hollow dawn
hollow dawn
polar acorn
rich adder
hollow dawn
polar acorn
#

and more to do with your entrance condition

#

since it's not entering

rich adder
#

did you check its actually going in that state

polar acorn
#

so what is that condition?

hallow totem
#

Now there aren't any. :/

hollow dawn
polar acorn
hollow dawn
rich adder
polar acorn
#

Meaning there is an operator and a number

rich adder
#

still waiting on this 🪦

polar acorn
#

So what is the actual condition

rich adder
#

lol why does discord blow up pngs wth

hallow totem
#

Okay but why isn't it running? It's on the sword, the sword has a colider, so does the player.

hollow dawn
polar acorn
rich adder
#

at this point you need a crash course on Animator

#

instead of guessing your way through it

hollow dawn
polar acorn
flint python
#

Does anyone know how to check what caused this issue? I go through every game object and i dont see any script missing

rich adder
hollow dawn
#

holy shit im dumb

rich adder
#

you had it fine before dude , it was just backwards

hollow dawn
#

lmao šŸ˜‚ realised what I did

rich adder
#

< 0 wouldve been fine

#

you did a whole another weird

hollow dawn
#

haha

rich adder
hallow totem
rich adder
#

also OnCollisionStay expects you to hold a collision

#

dont think its like OnCollisionEnter

hollow dawn
#

wait the walking backward animation is playing but only half of it how do I fix this?

rich adder
hallow totem
hollow dawn
rich adder
hollow dawn
rich adder
hollow dawn
rich adder
rich adder
trail heart
#

Pro tip when making a video take a second to show through all the transitions

hollow dawn
rich adder
rich adder
#

makes no sense

#

thats still smaller than -1

#

your conditions are fighting each other

hollow dawn
#

what is it supposed to be?

rich adder
#

probably larger than -1 ?

#

look at your velocity.z value when you let go of S

hollow dawn
rich adder
#

also whats gonna happen if you ever change your speed?

#

now your whole animator breaks

#

don't use exact numbers

#

you had the right idea before

#

it was just backwards

#

it should've been Smaller than 0.01 or whatever for Idle->WalkB

#

Greater than -0.01 should've went to to WalkB -> Idle

#

I feel like if I don't tell you directly we're gonna go all day here lol

queen adder
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

cosmic dagger
#

check the pinned messages and start from there . . .

willow scroll
#

This is not a place to find a tutor. Here you ask the particular questions.

void thicket
willow scroll
queen adder
willow scroll
#

color.set calls the SetColor

void thicket
#

Material.color only works when property name is "_Color" or attributed with [MainColor]

queen adder
void thicket
#

What do you mean "how" I literally told you

queen adder
willow scroll
#
set
{
    int firstPropertyNameIdByAttribute = GetFirstPropertyNameIdByAttribute(ShaderPropertyFlags.MainColor);
    if (firstPropertyNameIdByAttribute >= 0)
    {
        SetColor(firstPropertyNameIdByAttribute, value);
    }
    else
    {
        SetColor("_Color", value);
    }
}
queen adder
rocky canyon
queen adder
rocky canyon
#

pingd the wrong person.. but im sure his response would be the same lol..

cosmic dagger
rocky canyon
#

yea i'm realizing

#

i gotta start looking at built in functions more often

cosmic dagger
#

unity 5 days . . .

rocky canyon
#

gotta remember that one

willow scroll
coral void
#

Is it possible to create systems/mechanics that interacts with each other in Unity and if yes, is there like starting point that, you guys can recommend?

buoyant knot
#

that’s an extremely vague question

cosmic dagger
coral void
buoyant knot
#

start with the flappy bird tutorial

#

work your way up

#

šŸ”“ Get bonus content by supporting Game Maker’s Toolkit - https://gamemakerstoolkit.com/support/ šŸ”“

Unity is an amazingly powerful game engine - but it can be hard to learn. Especially if you find tutorials hard to follow and prefer to learn by doing. If that sounds like you then this tutorial will get you acquainted with the basics - and then gi...

ā–¶ Play video
cosmic dagger
#

which one? there are tons of them. pick another one . . .

buoyant knot
#

and I already gave you a tutorial to follow

cosmic dagger
#

i doubt multiple tutorials all do not work . . .

buoyant knot
#

if everyone else here can make flappy bird following that tutorial, then you can too

#

it’s not rocket science. it’s flappy bird

#

if everyone else can make flappy bird work, then it is a you problem. not a problem with the tutorial

short hazel
#

This is an English speaking server

buoyant knot
#

but I do wonder if a <@&502884371011731486> cares?

short hazel
#

If you have nothing useful to say you can stay silent

rich adder
#

wth your problem

buoyant knot
#

idc anymore, because i blocked the guy. he’s your problem now šŸ˜‚

willow scroll
#

Why would you make people translate the sentences from the language they don't know if you can simply translate the sentences from your language to English?

cosmic dagger
#

what's the point of even being here? why do people waste their time?

rich adder
#

you wasted your own time by not starting from the basics

polar acorn
#

I already asked you to post your code and say what the problem is

#

And you did not

cosmic dagger
#

you should start with the basics of c# first. that will help get started . . .

willow scroll
#

This is a really great purpose. You're gonna get far with it!

untold hull
#

Sooo I'm trying to make a game over menu, I don't have the option for just a Button, it's either Button (Legacy) or Button TextMeshPro

swift crag
#

The latter is what you want.

polar acorn
#

Okay cool so piss off until you have something to actually ask a question about

swift crag
rich adder
untold hull
polar acorn
#

Protip: It's not the tutorial, it's you

cosmic dagger
#

also, if you have trouble with the tutorials, you should ask for help and provide where it went wrong . . .

swift crag
#

So "Button - TextMeshPro" is a pre-made object with an image and a child text

willow scroll
#

I feel like that's when a moderator should be pinned, no?

strong wren
#

!mute 894144860653781022 3d Stop being annoying

eternal falconBOT
#

dynoSuccess chalurr was muted.

swift crag
#

speak of the devil

buoyant knot
#

whenever in doubt with UI, Textmeshpro/TMPro is better than the alternative

swift crag
#

you can attach a Button to literally any Graphic (:

#

TextMeshProUGUI, Image, whatever

buoyant knot
queen adder
#

hello guys

polar acorn
#

I'm just gonna go ahead and count it anyway. I doubt I even need to see it.

"I did it exactly like the tutorial so why does theirs work and mine doesn't" counter:
Number of times it wasn't exactly like the tutorial: 161
Number of times it was exactly like the tutorial: 5
Number of times the code literally did not exist: 1
2022-07-19 to 2024-5-15
rich adder
#

or make your own buttons with IPointerHandler šŸ˜›

swift crag
#

new server policy: please ping mods before you do something that would get mods involved

#

thank you

#

šŸ™

buoyant knot
#

my spidey senses were tingling

rich adder
buoyant knot
#

i felt an unrepentant troll vibe

queen adder
buoyant knot
#

hi

queen adder
rich adder
#

this is a code channel

buoyant knot
#

if you don’t have a code issue, check another channel

willow scroll
queen adder
#

Someone Need Help With The Texture I Make Like Heron

rich adder
#

ohhhh

#

is this the same german dude?

#

or what

polar acorn
queen adder
polar acorn
#

you didn't actually go to a different channel

queen adder
#

;-;

polar acorn
#

This does not appear to be a code question

queen adder
buoyant knot
#

either way, this discussion does not belong in this channel

rich adder
willow scroll
buoyant knot
#

please go to the right channel, or the mods might have to escort you

polar acorn
rich adder
buoyant knot
#

i believe this person does not english good

rich adder
queen adder
#

So give me a friend request if you want me to create the drawing

buoyant knot
#

is it mod time?

polar acorn
rich adder
#

if you want to offer services use

#

link šŸ”½

eternal falconBOT
queen adder
buoyant knot
#

then start by reading, and following the rules

polar acorn
queen adder
#

;----------------------------------------;

buoyant knot
#

<@&502884371011731486>

queen adder
#

bye ;-;

short hazel
#

What is going on today

buoyant knot
#

idk, but I’m on fire

rich adder
short hazel
#

Pull out the community mod gatling gun

buoyant knot
#

just so you understand, only after I ping the mods can he suddenly understand any words

#

which is why i do not feel bad at all

short hazel
#

"Wait, my actions have consequences?"

strong wren
#

Looks like they left

buoyant knot
#

you’ll get them next time, danny

coral void
#

This pfp looks so fitting for moderator šŸ˜„

honest haven
#
UnityEngine.Debug:Log (object)```
#

im a bit lost why some are null

eternal falconBOT
buoyant knot
#

so you are SOL when it comes to debugging

#

there are a few things you can do, but it’s quite limited

polar acorn
honest haven
#

sorry whats SOL

buoyant knot
#

shit out of luck

honest haven
#

oh lol

buoyant knot
#

if you used a singleton, it would be easier to diagnose wtf is going on

#

and why it is null

honest haven
# polar acorn I figured your question would make more sense when half of it wasn't in spoiler ...

yh sorry some are null and some are not if (GameManager.instance.battleActive && !loadBattle) { loadBattle = true; StaticBattleEnemys.rewardEXP = rewardXP; StaticBattleEnemys.playerPosition = GameObject.FindWithTag("Player").transform; StaticBattleEnemys.enemy = enemy; StaticBattleEnemys.enemies.AddRange(battleEnemys); StaticBattleEnemys.SplashScreen = battleSplash; StaticBattleEnemys.rewardItemPosition = gameObject.transform; StaticBattleEnemys.rewardItem = rewardItem; StartCoroutine(LoadBattle()); }

buoyant knot
#

!code

eternal falconBOT
buoyant knot
#

read

polar acorn
buoyant knot
#

again

polar acorn
#

You are setting a lot of variables to things here. If it ends up null, then whatever you're setting them to is null

honest haven
buoyant knot
#

you keep not reading the thing people keep linking you

honest haven
#

yh i wouldnt call that a large block

#

define a large block

buoyant knot
#

my definition is digiholic explicitly asked you to use a pastebin, and you did not

swift crag
#

no, digiholic was asking Ginja to fix the weird blob of spoiler tags

honest haven
#

yes thats what i thought

swift crag
#

that is not a huge block of code. posting it inline is fine.

it's just missing the "cs" after the opening backticks to give it syntax highlighting

honest haven
buoyant knot
#

let the man say what he meant

polar acorn
#

But a coherent question was the missing sauce there

swift crag
#

"i don't think" is insufficient.

honest haven
#

i dont see why they would be null to begin with, ill add some debugs

buoyant knot
#

wait, is the whole point of this method to assign instance variables to static equivalents?

honest haven
#

its not null

polar acorn
honest haven
#

to pull the static vars

#

im not calling null or changing it any but here

#

i have no other reference to it

swift crag
polar acorn
#

I literally do not even know what the problem is

swift crag
#

what is the tangible error you are running into?

polar acorn
#

You've just said "some are null" but not what "some" are or what they should be or even how you're determining this information

swift crag
#

you don't get bonus points for being mysterious (:

honest haven
#

So when i go into a battle the battle starter passes the some bits of data to the battle scene

#

2 ticks

#

then i do my battle stuff, then when i return to this same scene i want to get thing like the player pos, enemy so i can set it deactive and then the reward prefab

#

but not all of then seem to be saving to the static class

swift crag
#

Okay, and how do you know that?

honest haven
#

my satic class

swift crag
#

You have not shown us an error or an example of any of these things being null

honest haven
#

because when i enter the battle scene i get this

polar acorn
honest haven
#
UnityEngine.Debug:Log (object)```
cosmic dagger
#

send us the classified documents . . .

honest haven
#
    {
        Debug.Log("|Splash Screen " + StaticBattleEnemys.SplashScreen + "|" + " + " + "|" + "Reward EXP " + StaticBattleEnemys.rewardEXP
                  + "|" + " + " + "|" +  "Player Position " + StaticBattleEnemys.playerPosition  + "|" + " + " + "|" +  "Reward Item Position " + StaticBattleEnemys.rewardItemPosition  + "|" + " + " + "|" + 
                   "|" + " + " + "|" +  "Reward Item " + StaticBattleEnemys.rewardItem  + "|" + " + " + "|" + 
                   "|" + " + " + "|" +  "Enemy " + StaticBattleEnemys.enemy  + "|" + " + " + "|");
    }```
swift crag
#

Do you destroy the enemy as part of the battle..?

honest haven
#

no

swift crag
#

i notice you have both enemy and enemies; what's the deal with that?

honest haven
#

yes enemies are battle enemie prefabs

#

enemy is the game object form the main scene that holds the battle starter

swift crag
#

and does that object still exist...?

honest haven
#

no i guess not as its a new scene

swift crag
#

well there you go. that object is gone

honest haven
#

if i made it a prefab would that work

cosmic dagger
swift crag
#

that wouldn't make any sense, because it'd be some random prefab

#

not the thing you bumped into

honest haven
#

So why would it remember the player pos but not the reward item pos, which is the enemys transform

#

both of them objects are not in the new scene

polar acorn
# honest haven ``` private void Update() { Debug.Log("|Splash Screen " + StaticB...

Okay this is miserable to read so I'm going to fix it:

 Debug.Log($"|Splash Screen {StaticBattleEnemys.SplashScreen} | Reward EXP {StaticBattleEnemys.rewardEXP} | Player Position {StaticBattleEnemys.playerPosition} | Reward Item Position {StaticBattleEnemys.rewardItemPosition} | Reward Item {StaticBattleEnemys.rewardItem} | Enemy {StaticBattleEnemys.enemy} |");
swift crag
swift crag
#

String interpolation.

honest haven
swift crag
#

It lets you insert expressions into a string

polar acorn
swift crag
#

Additively load the battle scene, do the battle, and unload the battle scene

#

the overworld will be exactly where you left it

#

you'll just have to make sure nothing happens in there while the battle is happening

#

(you could deactivate all of the objects in it, for example)

honest haven
swift crag
#

imagine loading a scene means putting all of the objects in it onto a stage

#

additive loading means you combine multiple scenes on the stage

#

the battle scene won't be "on top" of the overworld scene

#

they'll just both be present

honest haven
#

ok thats interesting, i will look into that but for the moment is there another alternative? i just want to keep a ref to the enemy

swift crag
#

don't unload the overworld

#

that's it, more or less

#

if you unload the overworld, every single object in it gets destroyed

honest haven
#

blimey lol

swift crag
#

If all you care about is preserving the object, I guess you could DDOL it too

#

why do you even need a reference?

honest haven
#

could i set a bool so say there are 10 npc and each one get there own number, could i pass that, then ref that as a unique id would that work

#

or is that to messy

swift crag
#

sure, you could store an identifier

#

that would let you find the NPC after you load back into the overworld

honest haven
#

if you was to pick one what way would you do it

swift crag
#

i would try to do additive scene loading, since that also means the overworld doesn't need to be completely re-created every time you leave a battle

#

although, a sufficiently good save-and-load system would make that less of an issue

#

if I was going to do single scene loading, then I think I would use a ScriptableObject to uniquely identify each overworld NPC. Each NPC would have an NPCInfo field that references an asset

#

you could make a dictionary that maps NPCInfo to NPC when the scene loads

#

you'd store the NPCInfo in your battle manager so that you can remember who you just interacted with

honest haven
#

Im gunna give the additive scene loading a go, would that mean that the whole game would be built that way

swift crag
#

you can still single-load scenes if you don't actually need to keep the overworld open

honest haven
#

ok cool, one last question if i was going to build a big game like say super mario world or somthing like that. and i added that all to one additive scene would there be performance issues, or is that way to big. the reason i ask is there is prob going to be a battle in every scene

#

my thinking was maybe make every scene 2 scenes

swift crag
#

You could have many overworld scenes if you wanted to.

#

You'd probably just have one battle scene

#

unless you need very different setups for different kinds of battles

honest haven
#

some battles different envirmoments

#

like paper mario

#

it says i cant ref things from 2 scenes, but static would work?

#

around the 50 sec mark of that video

swift crag
#

you can't put a reference to a Scene B object in Scene A, no

#

but you can find things in Scene B from Scene A, or have a singleton that helps you to find things

honest haven
#

thank you

#

SceneManager.LoadScene(1, LoadSceneMode.Additive); sorry what did you say about unloading a scene

buoyant knot
#

i just walk back in, to find the solution being the singleton that was proposed an hour ago

swift crag
#

I'd advise against trying to mash this into your existing project. Perhaps you should try it out in a smaller test project first.

#

(or pursuing a different solution)

#

If your overworld doesn't change very much, then it'll be easy to load back into it after the battle is over

honest haven
#
        SceneManager.LoadScene(1, LoadSceneMode.Additive);``` sorry i was missing code, sorry what i ment was do i need to add a second paramater
swift crag
#

well this would completely unload whatever scene 0 is

#

the premise was that you would keep the overworld open as you load the battle scene

#

then unload the battle scene

bitter crown
#

i dont understand what the issue with my code is can someone help me please?

cosmic dagger
bitter crown
#

if the Y position is less 2 than then the player position = bridge positon + (0,2,0)

#

sorry for not clarifying

#

the ")" is giving an "invalid" error

polar acorn
bitter crown
#

its not random

cosmic dagger
bitter crown
#

its a less than

polar acorn
cosmic dagger
#

what is 2<, that makes no sense . . .

formal escarp
#

Hi. I might need some help with this. I have two levels, one in which i dont have assigned the rigidbody thingy assigned and it works just fine. But now, i moved the players to another scene and it shows this error although it "works fine" but now is messing with other scripts.

bitter crown
#

becouse i want it to happen if the Y is less than 2

polar acorn
#

rather than equal to 2<

#

Which is utter nonsense

cosmic dagger
#

then why do you have == 2? also, that is not how you check if something is less than a value . . .

#

i suggest searching how to check if something is less than a value in c#. that's a simple search and basic c# . . .

strong wren
#

hi i have an issue

bitter crown
#

okay

strong wren
#

so i made some 3d moving code and everytime i press play i just fly in the air

#

i think i know whats wrong but i do not know how to fix

#

i have 2 seperate codes one for the camera alone and one for moving and i have a player controller on the Playbody that just dissapears once the game starts

bitter crown
#

i made that mistake before

queen adder
#

guys i'm have a trouble with my editor

cosmic dagger
queen adder
#

The code isn't auto completingf

strong wren
#

heres a before an after

strong wren
polar acorn
eternal falconBOT
strong wren
queen adder
#

ty

queen adder
strong wren
#

oh

polar acorn
eternal falconBOT
cosmic dagger
strong wren
#

this is the Looking Script

polar acorn
hushed hinge
strong wren
cosmic dagger
polar acorn
# strong wren no

Then why are you setting CP to this object's Character Controller in start

strong wren
#

oh

#

idk someone recomended i do as such

queen adder
#

it is already instaled, but i still haveing the same trouble

polar acorn
cosmic dagger
strong wren
#

alright i fixed the Controller issue

#

but i still am getting FLUNG in the air

queen adder
polar acorn
rugged pumice
#

Amm the issue is that i am doing like a videogame and i have a weapon and this throw projectile, i added a script an then this has appeared

cosmic dagger
strong wren
#

uhm actually im having a wierder issue i just turned off the code and i am still flying

polar acorn
queen adder
#

all my things are like that, idk why

warm cove
#

Hello! I am working on a game that uses different scenes for different menus, but the problem is that when I press a resume button on my pauseMenu scene everything in the main game scenes just sorta resets, the player position, all checkpoints gotten etc. I know I could probably cook up some code that saves that data but I was just wondering if there was any setting that saved it to the scene during the runtime

cosmic dagger
cosmic dagger
rugged pumice
#

I dont know what to do

#

The entire game is blocked

queen adder
polar acorn
cosmic dagger
cosmic dagger
strong wren
#

uhm the error fixed itself

queen adder
#

!ide

eternal falconBOT
queen adder
#

you mean these steps?

cosmic dagger
#

close out the IDE and Unity, restart, open Unity, open a C# file (from unity) and your IDE should open up . . .

rocky canyon
#

thats what the title says

rugged pumice
polar acorn
rugged pumice
polar acorn
rugged pumice
#

The rat is the enemy

polar acorn
#

That you are referring to in code

#

Show the code for it

rugged pumice
polar acorn
hollow zenith
#

Basically your object with a tag "Enemy" wants to find a script attached to that object called "Enemy"(this script doesn't seem to exist or is not attached to that object?)

short hazel
#

Class Enemy does not exist, there should be a red underline on line 27. Since you don't, you need to configure VSC to get the full programming tools the code editor provides

#

!vscode

eternal falconBOT
#
Visual Studio Code guide

If your IDE is not underlining errors in red or autocompleting code,
please configure it using the link below:

https://on.unity.com/vscode

faint agate
#

helo can someone help me with something im stuck on

slender nymph
faint agate
#

My script is to make the player crouch slide when press " C " but the transition to crouch is not smooth. What I need help with is smoothing out the localScale with the code I have since it snaps to crouching and back standing.

#

here is the code

slender nymph
#

you'll want to change the scale over time rather than just immediately assigning it to your desired scale. you can do that using lerp or movetowards in Update or a coroutine

faint agate
#

thank you will try

honest haven
# swift crag well this would completely unload whatever scene 0 is

I have another question. Im going to go with the additive load, now i wrapped my town scene in a empty object so i can just toggle it on and off. and when i end the battle i well unload the scene(detroy). But what if i also want to load into a house. would it be silly to also keep that in the same scene? and i would have to wrap that in an empty too becuase i dont want to delete that. So really the only purpose of using additive are for battles. would that look messy having some that can be unloaded and some that can not?

tranquil hollow
lofty sequoia
#

fix your animation transitions

tranquil hollow
#

how can i do that?

rocky canyon
#

welll the death animation should probably not be loopin

strong wren
#

whats the or sign for if statements?

#

like && is and == is if

untold bear
#

Hey, I''m spawning an object using Instantiate(prefab, parent);, the gameobject reference is stored properly and even after few frames the scene and transform all seem right. But the problem is that the object is not showing up in the unity hierarchy at all, like it doesn't even exist

strong wren
#

i know theres a or which is like II but idk how to get the long I

slender nymph
polar acorn
untold bear
strong wren
slender nymph
untold bear
#

okay so I can check if it's being destroyed by doing if(chunk == null) Log("destroyed");

slender nymph
#

you can also put a log in OnDestroy if you want to check if it is being destroyed

untold bear
#

ah makes more sense i'll have a look

strong wren
#
       {
           Speed = 10;
           Stamina -= 1 * Time.deltaTime;

       } else if (Input.GetKeyUp(KeyCode.LeftShift))
       {
           Speed = 5;
       }``` hey guys i have an issue with my tiny code
#

when i activate running mode the Stamina only goes down once instead of going down periodically

wintry quarry
#

GetKeyDown is only true for one frame

strong wren
strong wren
wintry quarry
untold bear
strong wren
#

how wil i add sprinting 😩

polar acorn
#

You can just look these things up you know

wintry quarry
strong wren
strong wren
wintry quarry
#

isn't it more embarassing to be publically incorrect?

strong wren
#

i was thinkking maybe using a bool

strong wren
wintry quarry
strong wren
#

sorry i just had to be sure

#

is the way im even adding springing good?

#

and yes it works UnityChanCelebrate

wintry quarry
#

I don't see anything related to "springing" here

slender nymph
wintry quarry
#

Oh I guess maybe you mean sprinting?

strong wren
wintry quarry
#

seems fine ĀÆ_(惄)_/ĀÆ

strong wren
#

alr cool now i just need to make it so after some time it will regenerate

#

which seems easy right?

#

just another if sentence

#

whats the not equal sign?

#

!= right?

untold bear
#

at first I thought it was because it had invalid scene references but I fixed that issue and the scene reference is now same as the other objects in the scene

slender nymph
#

show the full relevant code

strong wren
#

whats the combo for AND / OR?

#

|& doesnt seem to work neither does &|

wintry quarry
ivory bobcat
strong wren
wintry quarry
#

aka OR

strong wren
wintry quarry
#

For reference if you want if only ONE is true and NOT the other, that's called "exclusive or" aka "XOR" and it's != for logical exclusive or and ^ for bitwise exclusive or

untold bear
slender nymph
#

click the log in your console and it will highlight the object in the hierarchy

untold bear
celest holly
#

whats wrong with this magnitude check? it doesnt work properly

wintry quarry
celest holly
#

its settingg the closest cell as the first one in the loop

#

even though its not the closest

cosmic dagger
wintry quarry
#

to print out what distances its finding

#

and what it's comparing them to

celest holly
celest holly
#

so im at a complete loss

wintry quarry
#

rather than waiting until you find the closest one

#

you need to do the whole loop first

#

then set kinematic = false at the end because only then have you found the closest one

celest holly
#

yeah i did that for testing purposes my bad

wintry quarry
#

otherwise you're just doing it on each one that is the "current closest candidate"

short hazel
#

There might also be only one object, so the loop is executed once

celest holly
#

but its only setting one to nonkinematic anyway

celest holly
wintry quarry
#

Ok and how do you know that's not the closest?

wintry quarry
celest holly
#

because its not lol

wintry quarry
#

show us some more info

cosmic dagger
wintry quarry
#

we're in the dark

celest holly
#

okay hold on

#

ill send a video or something

wintry quarry
cosmic dagger
#

create the log, run the code, send a ss of the log from the console . . .

wintry quarry
#

it's not printing the distance for the ones that are closer than the current closest distance

#

basically - once you actually debug this, I'm sure it will become obvious what the issue is

#

putting that print outside a conditional would be a good first step

celest holly
cosmic dagger
#

that is true. also, did you want to set kinematic to false for every GameObject that is less than the current distance?

celest holly
#

okay ill debug more

celest holly
#

narrowed it down to the cell having a fixed position because its parented to an empty

#

so it doesnt matter where i shoot i get the same result

#

but position is meant to give the world position so idk

proven mirage
#

hey guys im in unity andi have a post processing effect in my game and im trying to acsess the field of depth through my script how can i do that?heres my code

#

is it even possible to acess depth of field from script?

#

if it is how can i?

proven mirage
#

@slender nymph like this?

slender nymph
#

PostProcessProfile is not a component

#

did you even look at what your previous code was?

proven mirage
#

oh yeah

#

oh

#

ok i tihnk i igot it

#

lemme check now

#

@slender nymph thank you

#

it works now i fixed

untold bear
rocky canyon
#

are you using version control?

#

i found a thread saying this guy hadn't checked out certain assets and they were greyed out until he renamed them.. which they became visible (b/c of having a different name associated with it).. thats the only thing i see off hand

sage thunder
#

Anyone know if its possible to transfer custom normals between meshes within Unity itself? I have an imported FBX of a mesh with weights and blenshapes. And another without those, but has the custom normals. I want to transfer those normals to the first mesh (they have identical vertex order.)

digital wharf
#

I have a problem with my spherecast that I am trying to use as a groundcheck. For some reason, ground is only detected for a fraction of a second and then the spherecast returns false.

#
//only showing relevant code

public Transform orientation;
public float playerHeight;
public float playerRadius;
Vector3 direction;
RaycastHit hit;
public LayerMask groundLayer;


direction = transform.up * -1.0f;

grounded = Physics.SphereCast(orientation.position, playerRadius, direction, out hit, playerHeight, groundLayer, QueryTriggerInteraction.UseGlobal);```
digital wharf
untold bear
grim pecan
#

I’m trying to load a scene from a video and every time I do it there aren’t any textures

#

It only purple

#

I download the shaders he had to and that didn’t work

slender nymph
#

not a code question, but if all of your materials are magenta then you are using shaders that are not compatible with your render pipeline. you need to convert the materials to shaders that are supported on whatever pipeline you are using

slender nymph
#

depends on what render pipeline the materials were designed for and what pipeline you are using. but you can usually just change the shader on the materials to one supported by your pipeline and reassign any properties that weren't automatically remapped

wheat wave
#

my second question is if you disabled any mesh collider optimizations

digital wharf
wheat wave
#

that shouldn't be the case

slender nymph
#

well how about you start with providing literally any useful details, such as what render pipeline you are using, and what render pipeline the tutorial uses

grim pecan
#

I don’t know what a render pipeline

#

And we’re in the beginner chat so don’t expect everyone to instantly give details

deft grail
lusty flax
#

I'm using SpriteRenderers' bounds.Intersects() function in order to detect if an object can be placed in a spot in a grid-like placement system (to ensure that it does not overlap with other objects). However, this function seems to return true even when the objects aren't touching; when they are directly next to each other, the function still triggers. How can I fix this?

void Update()
{
    Vector2 mouse = Camera.main.ScreenToWorldPoint(Input.mousePosition);
    if (Input.GetMouseButtonDown(0))
    {
        if (mouse.x >= 0 && mouse.y >= 0)
        {
            GameObject model = Instantiate(selectedBuilding.model);
            float newX = selectedBuilding.dimensions.x % 2 == 0 ? (int)mouse.x : (int)mouse.x + 0.5f;
            float newY = selectedBuilding.dimensions.y % 2 == 0 ? (int)mouse.y : (int)mouse.y + 0.5f;
            model.transform.position = new Vector3(newX, newY, model.transform.position.z);

            Renderer modelRenderer = model.GetComponent<Renderer>();
            int amountOfBuildings = buildings.childCount;
            bool survived = true;
            for (int i = 0; i < amountOfBuildings; i++)
            {
                GameObject building = buildings.GetChild(i).gameObject;
                Renderer buildingRenderer = building.GetComponent<Renderer>();
                if (modelRenderer.bounds.Intersects(buildingRenderer.bounds))
                {
                    survived = false;
                    Destroy(model);
                    break;
                }
            }
            if (survived)
            {
                model.transform.parent = buildings;
            }
        }
    }
}
grim pecan
#

bro my jumping isnt working anymore

#

neither is my dashing

#

ive tried to find whats wrong but cant

#

if someone can help me ill give them more information

slender nymph
#

show relevant code

#

and Don't Ask To Ask. don't wait for someone to be available, just ask the question and provide relevant details at the time you ask your question so that whoever is helping you doesn't have to try and persuade you to provide the details that #854851968446365696 says you should include

slender nymph
grim pecan
#

ok im sorry

#

its one of my other scripts that are messing with the jumping

#

ill try and figure it out and comeback here if i cant

slender nymph
#

you can share your code here if you need help

undone wave
#

question
let's say there exists a function

{
    transform.localScale = a;
}```

how would i extend this function to work on any compatible property (position, for example)

pseudocode describing the desired effect
```arbitraryFunction(targetProperty p, Vector3 a)
{
    p = a;
}```
lusty flax
# lusty flax I'm using SpriteRenderers' `bounds.Intersects()` function in order to detect if ...

To try to fix this, I just tried playing with the OverlapCollider function, looked at its documentation, and am stumped because it is not working. Can someone help?

Collider2D collider = model.GetComponent<Collider2D>();
ContactFilter2D filter = new ContactFilter2D();
List<Collider2D> colliders = new List<Collider2D>();
if (collider.OverlapCollider(filter.NoFilter(), colliders) > 0)
{
    Destroy(model);
}
else
{
    model.transform.parent = buildings;
}
teal viper
undone wave
#

oh, thank you

teal viper
#

Assuming it has overriden the assignment operator such that vectors can be assigned to it.

undone wave
#

sorry, i don't follow

remote osprey
#

hello everyone

undone wave
#

for example

#
{
    float timer = 0;
    Vector3 initScale = transform.localScale;

    while (timer <= animationTime)
    {
        if (animationTime == 0) break;

        transform.localScale = (initScale - targetScale) * Mathf.Pow((timer - animationTime) / animationTime, 2) + targetScale;
        timer += Time.deltaTime;
        yield return null;
    }
    transform.localScale = targetScale;
}```
remote osprey
#

I have a card animation that locks dragging movement. I wanted the drag movement to resume after animation is over. Is there something to do that?

deft grail
#

do the same to unlock it

remote osprey
#

oh nvm, it works without lockign

undone wave
# undone wave ```public IEnumerator scaleChange_outQuad(Vector3 targetScale, float animationTi...

i would like to extend this to work with not only localScale
right now i am storing this in a specific MonoBehaviour class.

The solution I am thinking is to store this IEnumerator in a ScriptableObject so other classes can access this, but I'm having trouble finding a method to replace the transform.localScale with a more general version.

Is this a good solution? If it is, how would I change it to accomodate any valid property and if it isn't what would be a better option?
(it is at times like these i wish i could use pointers as implemented in c)

faint agate
#

Hello, ive been trying to figure this out all day, but im still pretty new to coding. I have a script to make the player crouch slide when press " C " but the transition to crouch is not smooth. What I need help with is smoothing out the localScale with the code I have since it snaps to crouching and back standing. I tried adding lerp, but im having a hard time implementing it from the code I have since im accessing the playerobj