#💻┃code-beginner

1 messages · Page 350 of 1

frank zodiac
#

you mean screen record?

languid spire
#

no, show the current code and the console

frank zodiac
#

ok

#

the cube on the left is the enemy

#

the player is the capsule

languid spire
#

totally irrelevant, do what I asked

frank zodiac
languid spire
#

then you did not add the debugs as asked did you

frank zodiac
#

oh wait i just realized..

#

i put the debug in the if statement by accident lol

languid spire
frank zodiac
#

ok now it outputs enemy

keen edge
#

!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

frank zodiac
languid spire
frank zodiac
#

i thoght that was self explanatory

languid spire
#

not obviously, I dont know your setup

frank zodiac
#

i sent a screenshot, i thought that cleared the context up

languid spire
thin grotto
#

@frank zodiac would wait till someone else comes on. I've only been on this chat for about 10 mins and get the impression some of the people on here have an ego problem .

frank zodiac
frank zodiac
#

ok i fixed it thanks for your help chat

velvet turret
#

Steve, can you help me now?

languid spire
velvet turret
grizzled zealot
#

Is there an open-source asset to manage color palettes?

frosty hound
#

If you mean in editor, you can save colour palettes already in Unity

short hazel
#

You can use scriptable objects for that, if you need multiple and switch between them

frosty hound
#

Otherwise, SOs are the best way to go ^

grizzled zealot
#

Yes, I mean for managing colours for different elements.

#

Ok. I'll look into that. Basically the SO will have different public fields and I'll add a ColourMgmt component to associate an SO with a GUI element.

molten dock
#

anyone know why my navmesh agents would be walking circles around their target rather than stopping there

short hazel
molten dock
still wren
#

what is wrong with the code

#

my door is clunky and i can still close it when it is opening

#

when its opening and i press E on it, it plays a sound then waits a bit and starts closing

frosty hound
#

Start by verifying the length of your OpenDelay value

still wren
#

it is 1

#

actually 1.2

#

those are placeholder sounds

#

this is from a scriptable object

languid spire
#

so what does 'E' do?

still wren
#

E is what i as the character press to interact with the door

languid spire
#

I know that but show the code for it

still wren
languid spire
#

Is Toggable being used elsewhere?

still wren
#

toggleable does not get used anywhere else

languid spire
#

then the problem can only lie with your OpenDelay

still wren
#

their both 1.2

languid spire
#

yes, and? If the animation takes longer than 1.2 game seconds you have a problem

languid spire
#

then what you describe is, literally, impossible

short hazel
#

If I were you I'd rely on the animation instead of magic numbers to know whether an action has been finished. Animation events can be a solution

languid spire
still wren
#

thats what i tried

#

it didnt work

languid spire
#

Then it's Debug.Log time because what you say cannot be true somewhere

still wren
#

i think its to do with the animator

languid spire
#

There is certainly nothing wrong with the logic of your code

#

except the wait is dodgy as @short hazel said

still wren
#

yeah using the animator is probably the better way to go but its fixed now

#

thankyou for helping

grizzled zealot
#

Is there a method to simply open many inspectors in individual windows at the same time? I want to select 3 GOs, right click, and open them in separate windows (not tabs).

still wren
#

it was the animatorcontroller which i didnt know how to use

short hazel
grizzled zealot
short hazel
#

Why? Multi-edit is a thing, you can select multiple elements and edit properties on all of them at the same time

#

At least that works on GameObjects

grizzled zealot
#

You only see where properties are the same. I want to see them side-by-side to see the progression, e.g., as damage increases from one enemy to the next.

short hazel
#

You can't do this automatically

honest haven
#

top parent should be npc ss but it returns player

languid spire
#

just use transform.root

honest haven
#

sorry please ignore sorted it

faint agate
#

quick question, so when I slide I want the camera fov to change. Not sure why my code isn't working if someone could take a look. I was able to save, but something is preventing the fov from changing

languid spire
honest haven
#

will do thanks steve

wintry quarry
#

You're not changing it each frame during the slide

honest haven
faint agate
#

is this what you mean, I moved it into the update

wintry quarry
cunning narwhal
#

Trying to build a 2d sidescroller with procedural generation and subterrainian caves etc. not gonna lie it's been a bit hellish and I can barely get off the ground with this. Does anyone have any recommendation to some solid learning resources on doing this? I went through probably 10 full video tutorials on this and in the end I do get various versions of just terrain, sometimes cave generation, but then it gets infinitely more complicated when I'd want to add something they dont show like ores, items, etc randomly on the walls

atomic bison
#

in unity a singleton class gameobject can be in the hierarchy be children of another? or must be root in the scene?

short hazel
misty coral
#

is there anyway to disable navmesh control along the y axis?

#

like I want the y axis to be controlled by a different script

frail ferry
#

hey, im currently building a 2d platformer and got a "Bubblemeter" which is like a kind of mana that gets reduced when hitted by an enemy
https://gdl.space/dekojobini.cs

my problem is that when i collect a bubble it adds one bubble level and updates the ui element correctly now when i get damaged it reduces the bubble level correctly in other therm i have 0 bubble level then i got 1 and after being damaged i got 0 again

But if i collect another bubble wich calls the add function i somehow get 2 bubble level. i found out that the bubble level before adding is 1 but in the inspector it shows 0
thanks for helpers in advance :)

storm pine
#

Is there any way to obtain some text from a Input TextMeshPro without the ASCII 8203 character that appears at the end? I obtain the text doing inputText.text where inputText is a TextMeshProUGUI . Even a Trim() over this doen't remove it. I can do a Replace() after the Trim but I want to know if there is a better way or I'm doing something wrong

short hazel
#

public TMP_InputField inputField; + inputField.text

short hazel
frail ferry
#

1 time :(

short hazel
#

Make sure you have "Collapse" disabled in the console

#

And that there is only one instance of this BubbleMeter script in the scene

frail ferry
#

oh yeah i see

#

ty man you know how to prevent that it gets executed twice?

short hazel
#

Looks pretty packed with checks too. Do you have two of them on the same object by accident?

#

Although you do not call DeactivateObject() anywhere here, but it might be done from another script since it's public

frail ferry
#

mh il check that thanks for your time

fathom berry
#

is there a way to make a 3D character move in a 2D way?

languid spire
fathom berry
#

okieee

#

and how can i put 2D sprites in 3D

rich adder
earnest laurel
#

Heyo quick question I had, what do you call that feature in 3D games that will make an object slightly transparent so you can see the player model?

I've been trying to find some info on creating that effect for my game but i'm having some trouble. thanks for your time. catcrymic

molten dock
earnest laurel
#

ooh good idea let me get some!

earnest laurel
ember tangle
#
Vector3 newDirection = new Vector3(0, 90, 0);

float angle = Vector3.Angle(oldDirection, newDirection);```

'angle' is always 0. Why?
short hazel
#

The two vectors point in the same direction

#

Straight up

ember tangle
#

not in the y axis?

short hazel
#

They both point up, one is just twice as long as the other

#

As such they have zero degrees of difference between them

molten dock
#

the only way i can think of seems super unoptimal

languid spire
earnest laurel
#

ah thank you i'll try asking there then

polar acorn
ember tangle
#

where y is a rotation axis

ember tangle
#

when i think of them as points on a graph its obvious why my code didnt work

short hazel
#

Two direction vectors like (0, 1, 0) and (0.7, 0.7, 0) would be 45° apart

ember tangle
#

yeah I realize that Vector3.Angle() is not appropriate for what I was trying to do.

cunning narwhal
#

anyways I think I finally just decided after a year of thinking about it and failing at trying lol that I'm just gonna make the tilemap by hand instead of procedural generation. Kinda makes it a little more unique of an experience anyways. If I keep going this way I'm never gonna get anything done with this game so figured it's not the worst thing in the world to do

cosmic smelt
#

What is the best way to learn unity(C# i think)???

languid spire
eternal falconBOT
#

:teacher: Unity Learn ↗

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

torn grotto
#

I'm doing some coroutine stuff to add a death screen right now, and I can't figure out why it isn't working.
I have this coroutine that is being called when the player should die, looks like this right now.

public IEnumerator Die() {
    Debug.Log("Starting coroutine, awaiting finish");
    yield return StartCoroutine(GraphicUtils.FadeToAlpha(fade, 3, 0.9f));
    Debug.Log("Coroutine complete, calling all other coroutines.");
}```


This should, in theory, fade in a simple black screen, then fade in like buttons and stuff.
I know for a fact GraphicUtils.FadeToAlpha() is completing because I have some debug lines for it:
```cs
public static IEnumerator FadeToAlpha(Graphic i, float t, float a) {
    Debug.Log("FadeToAlpha called, t = " + t + " a = " + a);
    ...
    Debug.Log("Completed!");
}```


But the console never logs "Coroutine completed". Am I doing something stupid?
languid spire
#

2 obvious ones

  1. GameObject/Script is disabled/destroyed
  2. timeScale is being set to zero
torn grotto
#

My timescale is never changed, and I have confirmed the gameobject/script is still alive with a debug line in Update

#

Plus, stuff still continues moving in the background

languid spire
#

I'm guessing no errors in console

torn grotto
#

No errors.

#

Everything should theoretically be working perfectly

#

Idk what i'm doing wrong

#

Does stuff break if the original caller of the coroutine is destroyed? Because that does actually happen

#

One moment please

languid spire
#

yes it does, see point 1

torn grotto
#

I see

#

didn't realise that

#

If that's the case, why does the fade coroutine not break then?

languid spire
#

because it is static

torn grotto
#

yep that makes sense

#

thanks for the help!

#

Yep, fixed it.

knotty ferry
#

!code

eternal falconBOT
celest holly
#

what is it with the unity community that makes every comment either sarcastic snide or just rude 💀

restive ember
#

you seem to have a function that adds score already, so all you need to do is call that function whenever u run your script that spawns or deletes obstacles

#

since you already have it set up as a singleton its quite easy

#

lets say for example you have a script that deletes the obstacle

public Class HandleObstacles : MonoBehaviour
{
  public void Start()
  {
    // Code
  {

  public void Update()
  {
    // Code
  {

  public void DeleteObstacle() 
  {
    Score.instance.AddScore(5);
    Destroy(gameobject);
  }

}

you would call upon the function through the singleton like shown above

#

hope this helps

#

if you are asking about how to destroy the obstacles I would need more context as to what you are trying to do

languid spire
#

wtf is that link? Why change paste sites?

knotty ferry
languid spire
#

I see nowhere there where you even try to add a score

#

Suffix gave you the exact line of code you need to use

restive ember
#

yes I already gave you the answer but I wont write the code for you !

golden blade
#

I need some help

#

I dont understand what this error is

slender nymph
#

did you follow the instructions it said

meager sentinel
# golden blade

You need to enter the code and name it as what the code you want to assign is named

#

if you get what i mean

#

i think i explained myself wrong

golden blade
#

I dont

#

one second

slender nymph
#

show your console and the contents of the clickred script file

golden blade
#

is it the name clickred

meager sentinel
slender nymph
#

clickred is not the same as ClickRed

golden blade
#

ah understood

#

ty for ur time

slender nymph
#

although if you are using 2022.2+ that isn't actually the issue

golden blade
#

im using an old version

#

pretty sure

meager sentinel
golden blade
#

Ill be honest I just dont understand some of these errors when I fix one another appears

#

lmao

#

ok no im still getting the error

slender nymph
#

show your console

golden blade
#

FIXED

#

FIXED

#

👍

meager sentinel
#

you fixed a problem that i had for 1 year and was the reason i left unity for 1 year in 10 minutes

golden blade
#

Im sure something will come along and send me off for my 1 year training arc

ember tangle
#

Is there a way to get clockwise / anticlockwise information from Quaternion.Angle()?

thin grotto
#

There was one guy I just ended up blocking because their attitude towards some of the beginners on here asking questions was getting old real quick haha

#

Think for the community aspect might be more helpful using like Brackeys server, Gamedev.tv or like one of the other large game dev discords

flint wind
#

is there a way to add another string to the GetAxis? I wanna add "JoyX" as another option for controller

thin grotto
meager sentinel
frosty hound
#

Can you two bond over this hissyfit in DMs? If you're unhappy with how people volunteer their time here, then you're free to leave.

frosty hound
#

Yes yes, something about ego. Move on.

thin grotto
#

Maybe don't volunteer your time then if you're going to have a negative attitude to beginners asking questions is what I was pointing out...

frosty hound
#

You're free to volunteer your time and help how you like. 🙆

#

And I don't have a negative attitude towards beginners asking questions. But you having a little tantrum about it isn't productive in this channel. Unless you have a question or are actively helping people, please keep it to yourself.

stuck palm
#

im getting the print log fine, but the audio mixer isnt actually reflecting the changes. this error only happens on startup, when the volume changes from player input it works as normal.

private void ChangeVolume(float sliderValue)
    {
        print("Changed Volume to" + sliderValue);
        float volumeValue = Mathf.Pow(sliderValue, exponent);
        audioMixer.SetFloat(channelName, Mathf.Log10(volumeValue) * 20);
        PlayerPrefs.SetFloat(channelName, sliderValue);
        if (sliderValue == 0)
        {
            audioMixer.SetFloat(channelName, -80f);
        }
    }
wide vault
#

hi, i would like to lerp between score values but when i collect two coins (call function again) before lerp is finished it doesnt work properly. i would like to make it lerp between current score and final score but final changes before it finishes lerp and current score ``` IEnumerator CoinIncrement()
{
targetScore = 10 + previousScore;
Debug.Log("target score " + targetScore);
while (timerCount <= 1)
{
timerCount += Time.deltaTime * 0.5f;
amountCoins = (int)Mathf.Lerp(previousScore, targetScore, timerCount);
yield return null;
}
previousScore = amountCoins;
timerCount = 0;
yield return new WaitForSeconds(0.2f);

}```
thin grotto
slender nymph
#

oh and that WaitForSeconds at the end of the coroutine is pointless

wide vault
thin grotto
stuck palm
#

idk why that fixes it?

#

im assuming order like you said

frosty hound
#

And yes, if you're going to be moving towards a dynamically changing value, you don't want to use a coroutine. Doing it in update will be a lot easier.

thin grotto
polar acorn
grave frost
thin grotto
stuck palm
#

whats the difference between activeself and activeinhierarchy?

polar acorn
thin grotto
ember tangle
thin grotto
molten dock
#

i did also think that ppl are too rude sometimes

tidal kettle
#

quick question, i made a script that will pause/unpause the game with the esc key and i was wondering if i need to add it to an empty gameobject for it to actually work (like be active)

wicked cairn
tidal kettle
#

so an empty is the best idea for a pause menu?

wicked cairn
#

if you disable the gameobject it wont work either. youll need a empty one, or use the canvas object

tidal kettle
#

right

#

sounds good then

molten dock
#

i think for things like that, people will usually make an empty named gameManager to put those scripts in

tidal kettle
#

ohh thats smart

wicked cairn
#

you could also have a parent pause menu object with your pause settings and escape listener, under the parent is the actual panel

tidal kettle
#

thanks guys

stoic mural
#

https://www.youtube.com/watch?v=_H4azo71wOU&list=PLy1Xj-4F5G_cytIH8by-bZ9TVj5qKMlZn&index=9
I've been following this tutorial series trying to learn Unity and I'm trying to build upon it by adding UI icons that appear depending on the NPC via serialize field, I've been trying for a while but nothing I did really seemed to work all that well. I'm new to all this and if anyone can help it'd be greatly appreciated

My computer fan was screaming in this recording :( Getting a new computer soon to record better quality audio and video!

Chapters:
00:00 - Continuing the implementation
11:25 - Testing
12:10 - Debugging

Links
Discord Community: https://discord.gg/cVPCpGUSYW
Character Sprite: https://github.com/kiyama14/tutorial-art

▶ Play video
misty coral
#

is there anyway to control the vertical position of a navemesh agent

molten dock
#

you could maybe disable the navmesh right when you wanna do your thing

#

or like

misty coral
#

well like i made a monster neck and I want it to follow the player , but using a nav mesh it just drags along the floor, and using a base offset it cant adjust its height at all

molten dock
#

increase the height of the navmesh?

knotty agate
#

Any Method to let Linear X max value become 3. I tried edit the key's value to 3 (like left's picture)but not working

misty coral
#

I want the navmesh to be able to go up and down

molten dock
#

sounds like you should do that with animations

misty coral
#

man

#

or

#

can I move the object

#

that is following the navmesh

#

without moving the navmesh?

quasi escarp
#

Good morning/evening all! The versioning of Unity is a smidge confusing going into the Unity 6 release this year and the current LTS dropping out of support.
I am starting a new project and have heard that the LTS is the go, which makes sense. But given that the LTS is about to go out of support would it be better to use a more recent version like 2023.2.x? Or would it be better to hold on that, use the current LTS and wait for Unity 6 LTS to release?

wintry quarry
#

2022 LTS will be supported for at least 2 more years

#

Unless I missed some special announcement about it?

quasi escarp
#

Nah I think you're right, going back and reading again:
"We’re committed to supporting 2022 LTS releases with biweekly updates until mid-2024, after which updates will be monthly until mid-2025 (two years after the initial release date). These updates will only cover fixes aimed at improving the stability of the product to enable users to ship their projects."

I guess my coffee deprived brain read "until mid 2024" then totally switched off.

#

thanks for confirming though

molten dock
misty coral
#

I have the whole monster, with the navemesh on its head

#

so if the head goes up, the rest of the monster will too

#

but I figure out how to make the head move vertically

#

when using a navmesh

molten dock
#

howd u do that

misty coral
#

wym

molten dock
misty coral
#

mb my brain is not working

molten dock
#

or is that seperate to the issue

#

oh alr

misty coral
#

but I NEED to figure out how to make the head move vertically

#

originally I had a basic look towards and movetowards script

#

and i could make it work

#

but idk what to do using the navmesh, since I can't just do movetowards anymore

#

it like overrides it or something

#

i dont rlly understand it

eternal needle
molten dock
#

on some things, doing it in lateUpdate can ovveride

misty coral
#

so the head coming toward me

#

is dragging on the floor

molten dock
#

think i remember makin a navmesh agent fly away by overriding it wit the animation in lateUpdate

misty coral
#

i will look into it

molten dock
#

So maybe movetowards works too

misty coral
#

nvm

#

alr ill try

#

wait a minute

#

I have my navmesh code in a different file then the movetowards stuff will it still work?

eternal needle
misty coral
molten dock
#

wait it was transform.lookat that i overrided it with lateupdate not an animation

#

still try it

misty coral
#

but it doesn't rlly help my issue

eternal needle
misty coral
#

I have tried using base.Offset... since it technically moves the head vertically

#

it seem to break the neck code though

#

and the head starts moving freely

misty coral
#

If I use baseOffset I need to to be able to constantly change

#

I have tried this

#

the head actually falls through the floor with that codw

eternal needle
#

Well I'm not entirely sure what you're moving it towards, but ideally you would have it raycast and check where the ground is.

misty coral
#

I was just using that to test

#

to see if I could even control the height

#

I will try raycast next ig

eternal needle
#

honestly your easiest solution is just gonna be making an animation which moves the visuals up and down, the visuals being a child object of some navmesh agent.

misty coral
#

I was hoping to make the neck be able to reach through like small holes and stuff to get to you, is there any other way to still achieve that goal?

#

thats why im wondering if there is anyway to control the navmesh height off the floor

#

yk and making the neck not drag across the floor

eternal needle
misty coral
eternal needle
misty coral
#

any recommended tutorials for navMesh links, I started tinkering with navmesh... today....

#

so Im not very familiar with ANY of this

eternal needle
#

also some tutorials you'll find online. ive never watched any on links so cant really suggest. Its just what i imagine will be the easiest solution for a small hole since setting up the navmesh surface to include the hole as a valid surface will be annoying.

misty coral
#

ty

queen adder
#

how can i shake the camera and then it make look like its shaking the ui? im using screen space camera

grave frost
#

Although it would probably be more clear to put the wait in the Something() method.

sullen galleon
eager spindle
#

I'm ngl I've never seen Touchscreen.current.position

#

Usually I use the Input.GetTouch(i)

#

Might check it out later

#

@sullen galleon

sullen galleon
#

yeah its the new UnityEngine.Input thing

eager spindle
#

Oh input system 😨

sullen galleon
slender nymph
#

i like how people are still calling it the new input system depsite it being nearly 5 years old

sullen galleon
#

i thought its like 2 lol

slender nymph
#

nope, released with 2019.1 in october 2019

eager spindle
#

And that's in stable too

#

If beta is counted it'll probably be earlier

#

The current interface is pretty confusing ngl

sullen galleon
#

well im just gonna copy paste this in input system cause ive been trying to get touch controls done for over 2 days now i think

eager spindle
#

Ive been following a lot of tutorials but haven't been able to set up actions for touch screens with Input System

sullen galleon
#

dreadful

eager spindle
#

Remember to have Input Manager enables too in that case

grave frost
sullen galleon
#

funnily enough it kinda worked when i put some type of mouse controls in a long time ago when i was starting

eternal needle
grave frost
slender nymph
grave frost
#

Instead of enabling it, you have to disable it

#

to my knowledge

eager spindle
#

The days of Input.GetAxis("Horizontal") are over

grave frost
#

i mean im using unity 6 as we speak and it was enabled by default

grave frost
slender nymph
grave frost
slender nymph
#

i'm going to test this right now, because to my knowledge it is still an option package that is not installed by default, like cinemachine

grave frost
#

also has a project-wide "default" input asset with some keybindings already set up

sullen galleon
#

ok i definitely dont have that in 2022.3.16f

grave frost
#

no it's new with unity 6 I believe

#

It looks like they're also finally starting to depreciate the Built-In Render Pipeline too

slender nymph
#

i doubt BiRP is ever going to be fully deprecated, but it isn't one of the default templates now, yeah

grave frost
#

Why would it ever not be fully depreciated?

eager spindle
#

I use it because every time I try to set up my own post processing in urp I fail miserably

#

In birp I can just Camera SetShader

grave frost
#

also @slender nymph just created a new project to double-check myself, yup it's default installed now. You can remove it, the package isn't locked.

eager spindle
#

What about the settings for which Input to use? Is it Input Manager, Input System or both?

slender nymph
#

just confirmed myself too, it is installed by default. and active input handling it defaulted to Both

grave frost
#

yup

grave frost
slender nymph
#

also seems to be defaulting to dx12 for windows graphics now and .net standard for api compatibility

grave frost
#

I did try HDRP and it was dx12 I remember.

slender nymph
#

ah yeah, i guess i selected the hdrp template by accident. meant to select urp but oh well lol

grave frost
#

Time for me to ask an actual question. I think I'm going insane because somehow I'm getting numbers higher than I think they should be.

public class TerrainHeightPassPerlin : TerrainPass
{
    public override float MaxHeightDifference => _heightMultiplier;

    [Space, Header("Perlin Noise")]
    [SerializeField] private float _perlinMultiplier = 0.2f;
    [SerializeField] private float _heightMultiplier = 1f;
    [SerializeField] private float _heightSnapping = 0.25f;
    [SerializeField, Min(float.Epsilon)] private float _minStrength = 0.25;

    private Vector2 _offset;

    public override float Process(float n, Vector2 pos)
    {
        Debug.Log($"Recieved: {n}, {pos}");
        float r = Mathf.Max(n * Mathf.PerlinNoise((_offset.x + pos.x) * _perlinMultiplier, (_offset.y + pos.y) * _perlinMultiplier), _minStrength);
        Debug.Log($"r: {r}");
        return Snapping.Snap(r * _heightMultiplier, _heightSnapping);
    }

    public override void Reseed()
    {
        Unity.Mathematics.Random r = new((uint)UnityEngine.Random.Range(1, int.MaxValue));
        _offset = r.NextFloat2(new float2(-2000, -2000), new float2(2000, 2000));
    }
}

when n is 1, pos is some vector where both x and y is in the range [0, 40), Process() can return numbers like 3.2. I'm pretty sure PerlinNoise returns 0-1 (or numbers slightly out of that range), so it can't be that. Could the snapping function really be snapping a number really high like to 3.2?

#

oh I forgot to change the numbers to their proper values one second fixed

#

I can see here that it appears to be snapping 0.6308... to 3.2?

slender nymph
#

that is 15 seconds later and in some completely different code. are you sure your console is not set to collapse and you aren't doing anything to the values being used in those 15 seconds?

grave frost
#

this is the loop that highlighted debug.log is called in:

pos.y = 1;
for (int k = 0; k < terrainPasses.Length; k++)
{
    pos.y *= terrainPasses[k].Process(pos.y, new Vector2(pos.x, pos.z));
    Debug.Log($"k: {k}, pos.y: {pos.y}");
}

When k is 0, pos.y is 1.

#

shoot hold on

#

I mean I can visually see that the numbers are going out of the range I think they should be in, but let me check

#

it was set to collapse, I usually have that off, my bad. It seems to snap 0.8186... to 1.8 however, even when the height multiplier is set to 1.

slender nymph
#

show the log before that too

grave frost
#

ok im having a skill issue reading logs, sorry boxfriend.

slender nymph
#

you've got three logs that are important here. two are in Process and the third is in that loop. show all three of those

grave frost
#

is the snap function freaking out because I'm putting a decimal in?

slender nymph
#

have you confirmed that _heightMultiplier is the value you expect it to be?

grave frost
#

yea it's on a scriptable object, TerrainPass is just this:

using UnityEngine;

public abstract class TerrainPass : ScriptableObject
{
    public abstract float MaxHeightDifference { get; }
    public abstract float Process(float n, Vector2 pos);
    public abstract void Reseed();
}
slender nymph
#

change that second debug in the Process method to this: Debug.Log($"r: {r}, heightMultiplier: {_heightMultiplier}, snapped value: {Snapping.Snap(r * _heightMultiplier, _heightSnapping)}");

grave frost
#

I'm having trouble finding any that are screwed up right now

slender nymph
#

time to use the debugger then and set some conditional breakpoints that will break when a value is outside of the expected range

grave frost
#

ooh yes i forgor about conditional breakpoints

#

But I'm not even sure if snapping is the issue. Perhaps I was just being stupid. This is the visual problem I have, the scale is somehow 16 even though the height should at most be 1 * 5 (since I have two of these scriptable objects) I thought

slender nymph
#

it's not going to be the snapping that is the issue. it is going to be the input values and the math you do. so you'll need to figure out where the values are that you do not expect

#

but also with your previous log where r was 0.667 and the pos.y ended up being 3.4, if you are multiplying r by 5 it will by 3.33 snapped to the nearest 0.2 is 3.4 so the math and snapping was all correct with that set which indicates the issue is something on this line: Mathf.Max(n * Mathf.PerlinNoise((_offset.x + pos.x) * _perlinMultiplier, (_offset.y + pos.y) * _perlinMultiplier), _minStrength);

grave frost
#

hmm skill issue with logs on my part. I still am not understanding how I'm getting 16 as a final value though, I've been going through it for a while.

Actually, I can't find a 12.4 here (final should 12.4 + 1), even with some new debug logs:

                var c = _instantiatedWorld[i, j];
                Vector3 pos = new Vector3(c.position.x, 1, c.position.z);

                for (int k = 0; k < terrainPasses.Length; k++)
                {
                    pos.y *= terrainPasses[k].Process(pos.y, new Vector2(pos.x, pos.z));
                    Debug.Log($"k: {k}, pos.y: {pos.y}");
                }

                Debug.Log($"pos.y before snap: {pos.y}");
                pos.y = Snapping.Snap(pos.y, _globalPostProcessingSnapInterval);
                Debug.Log($"pos.y after snap: {pos.y}");

                c.transform.localScale = new Vector3(1, pos.y + 1, 1);
                c.GetComponent<Renderer>().material.SetColor("_BaseColor", new Color(pos.y / _maxHeightMultiplier, pos.y / _maxHeightMultiplier, pos.y / _maxHeightMultiplier));
```They *are* set to a parent, but it's scale is 1, 1, 1.
slender nymph
#

you're searching for 13.4 but you never log that value, you log it before adding 1

grave frost
#

hrmm.. how could it even be reaching such high numbers?

slender nymph
#

just use the debugger

grave frost
#

yea

frigid sequoia
#

Maybe I am absolutely dumb for asking this but If the blue position is the object position + vector3.forward * distance; how could I calculate the green positions?

#

It just seems like there is probably already a method for that

cosmic dagger
#

you would rotate the direction by x degrees . . .

frigid sequoia
#

How do I rotate the direction from vector3.forward? Sry, I am just like abolutely dense rn

#

I am pretty sure I did something similar before but I just can't recall for some reason

topaz mortar
#
        {
            if (TownController.Instance.LoadingItem)
            {
                Debug.Log("Waiting for item to load.");
                return;
            }

            TownController.Instance.LoadingItem = true;```
Any idea why this isn't preventing me from spam clicking?
slender nymph
#

does anything else modify the value of that variable?

topaz mortar
#

nah, I have an async function in there that's causing it 😦

#

added an await, now it's working 🙂 weird

fringe plover
#

I Hate il2cpp.. it randomly gives me null obj reference when i start up game (Android)

#

in build ofc

#

there is no errors while building

slender nymph
#

you'll need to debug your build then. for android you'll probably want something like logcat to read the logs and see where the NRE is actually happening then you can investigate why

teal viper
#

Is this a coding question?

grizzled fulcrum
#

True, my bad

sour cobalt
#

Im having this issue with baking navmesh, which I believe it led the NPC clip through wall when playing
So when I try to bake my ground with no object involve, it baked fine, but when It have object, it can't be baked, I tried lower the ground without baking again and when NPC using navmesh, it chose the path with wall and somehow clip through it too.
In the video I try showing all the object is static, the NPC have rigid body too, so don't know why which happen, thanks for all the help
https://streamable.com/wngd82

Watch "2024-05-19 14-23-58" on Streamable.

▶ Play video
languid spire
#

you may need to reduce the Agent radius as well

sour cobalt
#

Foxy_Pray thanks for the help

golden blade
#

Helo I want to make a slot machine but im not sure how to go about it, do I have to animate every possible outcome

#

and then randomize which animation plays

languid spire
languid spire
#

acually you can just make a prefab for a reel and then duplicate that for the number of reels you want

golden blade
#

im assuming that means I make one of the spinny things and then duplicate it

languid spire
#

yes a 'spinny thing' is a reel

golden blade
#

bless

violet glacier
#

Hey, does anyone know how to tint/darken a ui gameobject and it's children? (I have a button with image and text, when clicked, I want all of them to darken)

willow scroll
#

Note that

each color component is a floating point value with a range from 0 to 1

violet glacier
willow scroll
#

RGB represents Red, Green and Blue, and is respesentet in a range of 0 - 255.
So (255, 255, 255) is the most white, and (0, 0, 0) is the most black color.

If you have a color (200, 100, 50) and want to make it 2 times darker, you decrease its every value by 50%, which gives you

(200, 100, 50) * .5 = (100, 50, 25)
#

The Unity's Color has the values with a range from 0 to 1, so this will give you the color

(200, 100, 50) =~ (.78, .39, .2) * .5 =~ (.39, .2, .1)
#

And changing the color of the parent doesn't usually change the color of its children

#

I wonder whether there is a built-in Component for this. Anyway, you can make it yourself, which shouldn't be too complicated

knotty ferry
languid spire
willow scroll
knotty ferry
#

dam

willow scroll
#

You have to adjust the strings you set you show the desired result, which, in your case, includes "Score: "

topaz thistle
#

Can I use compound colliders as a trigger?

#

Lol ok

static cedar
topaz thistle
#

Below is my on collision code, the Gameobject this is attached to is a compound collider, does anyone know why this isn't working? (Let me know any details I can provide that could help)
private void OnCollisionStay2D(Collision2D collision)
{
controller.isInOcean = collision.Equals(playerCollider);
Debug.Log("Happens");
}

languid spire
#

what do you expect this to do?

collision.Equals(playerCollider);

collision and collider are 2 different types so can never be equal

topaz thistle
#

So, that doesn't mean the collision of the colliders?

languid spire
#

no, of course not

topaz thistle
#

Okay, thank you. I do have to ask, my goal is for a compound collider to act as a trigger. Once it is triggered by my character, it changes the function of the character through a boolean (isInOcean). How do you suggest I do this?

languid spire
#

maybe, if youi looked at the documentation, you would see that Collision2D has a collider property

topaz thistle
#

So if I do collision.collider.Equals(playerCollider), it would grab the collider of the other gameObject?

languid spire
#

indeed

topaz thistle
#

Unfortunately, it doesn't seem to function correctly. I made that change and once the player enters the compound collider trigger, it does not set isInOcean to true. Do u have any other idea on what could be the issue?

languid spire
#

then you obviously need to Debug.Log the 2 objects so you know what you have hit

slender nymph
topaz thistle
long tiger
#

I have a question regarding box colliders. I want to attach this box collider trigger to the actual model but im not sure how to do so, any tips? I wanna have it attached to the player's arm

faint sluice
slender nymph
faint sluice
topaz thistle
#

Yeah, it didn't actually fix the problem, but I get your point

stuck palm
long tiger
frank zodiac
slender nymph
#

you can't assign a single float to a Vector2

frank zodiac
slender nymph
#

why not look at all of the other lines you assign the velocity and take a guess from that context?

frank zodiac
slender nymph
#

put a log outside of the if statement to make sure that OnTriggerEnter is actually being called

frank zodiac
#

i just need to make a new vector2

slender nymph
frank zodiac
#

but thanks

long tiger
#

yooo a fellow ghazi lol

hollow dawn
#

I've been trying to fix this all day and I just don't know how. I am making an FPS game and as you can see in the video when the player is moving the camera also moves along with the animations. I don't want it to move when the player is moving.I want the camera to be still for an example modern ware 3 when moving the camera doesn't move. If nobody helps me istg I'm gonna go crazy thanks.

long tiger
#

never thought id see the day

short hazel
hollow dawn
#

I upload it to YouTube so it's more simple https://youtu.be/XTwMaP49Lvw?si=KqQq8twRIQvjefE9

I've been trying to fix this all day and I just don't know how. I am making an FPS game and as you can see in the video when the player is moving the camera also moves along with the animations. I don't want it to move when the player is moving.I want the camera to be still for an example modern ware 3 when moving the camera doesn't move. If nob...

▶ Play video
queen adder
#

How do I make it so that the variable becomes false?

on Play, the variable "touchingSomething" is false because it's not touching anything, but once the circle falls and bounces it is always True, when it goes up in the air, it's still true. If I grab my circle in the Scene view and just hold it in the air so it's not touching anything, the variable "touchingSomething" is always true and never becomes false.

short hazel
#

Usually, the animated model is a child of an empty GameObject that's the "player root"

hollow dawn
short hazel
wintry quarry
#

Presumably there's no collision when you're not touching anything

frank zodiac
#

are void OnEnable() and OnDisable() even necessary

queen adder
#

oh, so since it's not touching anything it stays true because that was the last setting for it

#

and I should set my variable to false, outside of the foreach loop

short hazel
queen adder
#

ok I will move some code around ty

short hazel
# queen adder ok I will move some code around ty

Before the loop, you can check whether .contactCount is 0, and if it is, set the bool to false.
There's also a flaw in this code which is in the case there are 2+ contact points and the last one doesn't have a normal Y greater than 0.95, it will set the bool to false, even if there were contacts that satisfied the condition earlier in the loop.
You should break; out of the foreach loop as soon as you find a "valid" contact

languid spire
short hazel
#

Perfect, all cases are covered here

queen adder
#

for some reason my variable is always true, it's only false at the start of play, then as soon it touches one thing, it becomes true always, even when it's free falling to oblivion

short hazel
#

Well OnCollisionStay won't get executed if you don't touch anything

queen adder
#

ohhhhhhhh

#

right lol, so where should I put the check?

short hazel
#

OnCollisionExit, set to false

slender nymph
#

honestly that method should return a bool instead so it could look more like this:

public bool TouchingSomething(Collision2D collision2D)
{
  foreach(var contact in collision2D.contacts)
    if(contact.normal.y > 0.95f)
      return true;

  return false;
}
frank zodiac
#

whats the difference between the tap and press?

slender nymph
queen adder
frank zodiac
frank zodiac
queen adder
frank zodiac
#

let me check the other version

inland knoll
#

hi! im new in the progamation and i need a script to generate a objet in a random position five times. Can somebody help me? Thank you for the atention, greetings from Argentina

wintry quarry
inland knoll
#

ah, ok, sorry

#

where is the place to my question?

inland knoll
#

thakyou very much!!

queen adder
#

np

inland knoll
#

Sorry for the inconvenience, but the script does not work correctly, I need them to appear at the beginning and not when I press space, how do I do it?

wintry quarry
#

You should learn the basics of coding I'm Unity

#

Otherwise you'll be here asking for every little change

inland knoll
#

You're right, I don't bother them anymore.

languid spire
#

@queen adder And this is why we do not spoon feed

queen adder
queen adder
queen adder
queen adder
languid spire
queen adder
#

I'll be more mindful

frigid sequoia
swift crag
#

it can produce a rotation given an angle and an axis to spin around

#

e.g. Quaternion.AngleAxis(45, Vector3.forward) is a 45 degree rotation around the forward vector

#

and in a 2D game, the forward vector usually points into the screne

#

do not ask me if it's clockwise or counter-clockwise! i forget!

static cedar
#

I even wrote a simple function that returns a rotated vector. UnityChanClever

languid spire
swift crag
#

I suppose it's just like a rotation on the unit circle

real cradle
#

do you know how to fix that

#

and why he is so smoll

wintry quarry
#

not a code question though

real cradle
#

what shoul i set?

wintry quarry
#

whatever you want, it's up to you

#

how big do you want him to be?

real cradle
real cradle
wintry quarry
#

then the question has no answer

real cradle
#

thx bro

languid spire
# real cradle in the artist chanel no one respont

not really surprising. If you just post a screenshot and ask 'do you know how to fix that' How can you expect an answer?
Also, you do not go to the Bakers to buy Shoes just because the Shoe Shop is closed

bronze spade
#

!code

eternal falconBOT
hollow dawn
valid roost
#

!learn

eternal falconBOT
#

:teacher: Unity Learn ↗

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

short hazel
hollow dawn
short hazel
#

I'd use a setup like the following:

PlayerRoot (scripts: PlayerController)
  > Camera (PlayerLook)
  > Rig (Animator)
    > ...

So the camera is separate from the rig, but still attached to the same object as the rig

frank zodiac
wintry quarry
frank zodiac
#

well whats the issue

wintry quarry
#

don't you see this will overwrite the velocity to walking speed?

frank zodiac
#

ohhhh i see it now

#

should i just add them together then?

wintry quarry
#

not sure what you mean by that

frank zodiac
wintry quarry
#

how?

frank zodiac
#

i dont know, ill figure it out

wintry quarry
#

I mean what code would you write

#

Seems like you want the dash speed to replace the walking speed during the dash, not anything additive

hollow dawn
frank zodiac
#

i was running the same line twice

#

lol 😭

short hazel
short hazel
#

The animated model?

hollow dawn
short hazel
#

Right under it. I labeled it as "Rig" in my example

hollow dawn
short hazel
#

Modify the script so it affects the child object where the camera is

hollow dawn
short hazel
#

If done correctly that should be just swapping everywhere you set the current transform.rotation to another object's transform.rotation

hollow dawn
short hazel
#

It's your project you do what you think is best

frank zodiac
#

inputActions.Player.Dash.triggered; what does this return

wintry quarry
frank zodiac
wintry quarry
#

The docs certainly do

frank zodiac
short hazel
#

If you just put your mouse over triggered it tells you

wintry quarry
frank zodiac
frank zodiac
frank zodiac
#

oh it works thank you

short hazel
#

Server rules ask you to research before asking here, that includes looking up the documentation

short hazel
frank zodiac
#

thanks for the heads up

hollow dawn
#

@short hazel where should I put the camera root?

short hazel
#

Under the empty player root

#

Look at my example once more

hollow dawn
short hazel
#

Partially - the Rigidbody should be on the root object

hollow dawn
short hazel
#

It will construct a composite collider from all the colliders in the children, so there won't be any difference

#

That is exactly what I said yes

hollow dawn
#

in the camera what should I put in the player transform?

short hazel
#

Proceed with basic debugging steps. Are there any errors? Are the scripts being executed? Is input being received? etc.

#

You do not need to ping me with each reply btw, we are the only active conversation right now and I'm frequently switching tabs to see if there are new messages

hollow dawn
#

ok sorry but should I put anything in the player transform in the camera?

short hazel
#

Nothing else, it looks correct right now

frank zodiac
#

is there a function where i can move an object back and forth in a swift motion; like a spear weapon for example?

frank zodiac
deft grail
frank zodiac
wintry quarry
#

just an animation curve

frank zodiac
#

im not familiar with that

wintry quarry
frank zodiac
#

this?

frank zodiac
wintry quarry
#

yes

hollow dawn
short hazel
#

Yep the error message is pretty clear on that one

hollow dawn
#

if I change it will it break the project?

deft grail
#

instead of the old one

short hazel
#

Aren't you using the New Input System already?

hollow dawn
short hazel
deft grail
short hazel
#

So why are you trying to use the legacy Input class again?

hollow dawn
short hazel
#

If you separated the movement and camera look into two different scripts, it's as easy as adding another "Player Input" component aside the camera look script, and moving the relevant code that was in the player movement into the camera look script

frank zodiac
#

what does this mean

wintry quarry
short hazel
wintry quarry
#

you call methods with ()

frank zodiac
#

sneaky typo

hollow dawn
#

what shall I do man I did what you said and the script and inputs are working so why can't I move?

short hazel
#

Post a screenshot of the Inspector with the root object selected, and another with the camera selected

frank zodiac
#
public void OnAttack(InputAction.CallbackContext context)
{
    Debug.Log("attack");
    weapon.transform.Translate(new Vector2(Mathf.PingPong(Time.time, 0.75f), transform.position.x));
}

so basically when im running my game and i press the left click (attack) it just gives me these errors when the object is clearly assigned to the component

#

the weapon object is a child of the player object

short hazel
frank zodiac
#

nope, its just the one object

short hazel
#

Might be there twice on that object

hollow dawn
short hazel
frank zodiac
short hazel
# frank zodiac no it isnt

Disable the script by unticking its check box (aside its name) in the Inspector and see if you still get the error

grave frost
#

If its the only one in the scene at edit time and its a prefab, are you instantiating it? I noticed the weapon reference is a scene object which wont save in the prefab.

short hazel
#

Yeah might be normal if the events are still subscribed. Can you locate the line of code throwing the error, using the stack trace in the error message?

short hazel
#

We're going to add a special Debug.Log() that will highlight the object in the Hierarchy when you select it in the console

frank zodiac
#

but now it runs 3 times instead of once

#

lol i just had to apply the changes to the player prefab

#

that was the reason for the error

grave frost
#

How did you apply the changes to the prefab

frank zodiac
grave frost
#

The reference shows a scene object

#

if you had to apply the changes it makes me think you’re instantiating it

frank zodiac
grave frost
frank zodiac
#

i applied the changes to the player

short hazel
# hollow dawn

As I said, there should be a "Player Input" component on the camera object as well, so the CameraController script can receive the events raised when input is received
Unless they are routed from the PlayerController on the root object

grave frost
#

Ah, so originally it was a scene object and now that you applied it its part of the prefab

frank zodiac
#

also for some reason when i click left mouse button it runs 3 times

#

i only want it to run once

short hazel
#

Did you subscribe three times to the input event?

grave frost
#

I noticed the new input system runs 3 times on mouse clicks, are you using that?

bronze mortar
#

Hiii guys,
I recently made a game in Scratch and I want to turn it into a Unity game. I'm not very good at Unity coding, so I could really use some help with the transition. Any help would be awesome!

grave frost
short hazel
# hollow dawn it didn't do anything

Well that's normal, you need to add an input actions asset into it, and then look at what it tells you:

Will SendMessage() to GameObject: ...
Check that your input methods are listed there, and implement them in your camera controller script

grave frost
#

Where I first learnt C#.

bronze mortar
hollow dawn
grave frost
#

I’d say do that lesson to make sure you know your basics. Then you start by making the basic systems of your scratch game in unity.

When you don’t know how to do something search Unity’s Manual or API docs, google it, watch tutorials, or ask here

short hazel
frank zodiac
grave frost
grave frost
hollow dawn
short hazel
#

Yes... that's how it works
The PlayerInput component sends messages (events) to other scripts when input is received

frank zodiac
frank zodiac
#

and yeah i am

frank zodiac
rocky canyon
#
    public Vector3 FinalVector()
    {
        return finalVector;
    }``` can this be reduced to this..
```cs
    public Vector3 FinalVector() => finalVector;
``` i've used `=>` before with one liners.. but never used the `return` keyword.. 
my IDE removes it.. just checking
rocky canyon
#

thanks

grave frost
#

just using a => means it returns the right side if there’s a return type that isnt void

rocky canyon
#

i should probably be using a getter setter

frank zodiac
rocky canyon
#

in this case.. but i havent used those very often either

grave frost
short hazel
frank zodiac
#

wait

#

that was the wrong block of code

#

lol

rocky canyon
frank zodiac
#

ok it worked

grave frost
rocky canyon
#

ya, i agree.

#

just taking this opportunity to learn more sytnax sugar 😄

grave frost
rocky canyon
#

ya, thats what i mentioned earlier..

#

but it was a script that was already written.. and all the variables are private

frank zodiac
rocky canyon
#

soo i just figured id make duplicates for the other scripts to use

grave frost
short hazel
rocky canyon
rocky canyon
#

they get initialized via scriptable object in awake

grave frost
grave frost
rocky canyon
#

yea, they were public earlier.. but once i got it working i made them serialized private variables

rocky canyon
#

they're still in the inspector tho

swift crag
#

any time the function boils down to a single expression

rocky canyon
#

i'll probably lose the serializedfields once its finished

grave frost
#

that would apply all attributes in the same []s to the underlying field

slender nymph
#

alternatively, just leave the currently serialized fields and throw in some get only properties for public access. public Vector3 FinalVector => finalVector;
you won't need to fix serialization (since the backing field would have a different name you'd need the FormerlySerializedAs attribute or reassign in the inspector) with this since you're keeping the exact same serialized data and nothing inside the class needs to change with regards to assigning the field. the only thing that changes is now outside objects can read that data

rocky canyon
#

thanks guys! useful info, for sure

#

just trying to make this class not huge

rocky canyon
#

its the biggest class i have.. (originally it was 800 lines long)
but that was like 8 months ago or so.. i've learned so much since then..

no more nested if chains, and abunch of other nasty stuff i was doing

rocky canyon
frank zodiac
rocky canyon
#

it looks like its its position is constantly getting added to

frank zodiac
rocky canyon
#

let me look at ur script..

frank zodiac
#

alright

frank zodiac
grave frost
rocky canyon
#

you need to reset the position after each attack cycle

frank zodiac
rocky canyon
#
  private void Start()
    {
        // Store the initial local position of the weapon
        initialPosition = weapon.localPosition;
    }```
```cs
weapon.localPosition = initialPosition;``` before you do ur Pingpong
grave frost
rocky canyon
#

weapon.localPosition

#

u should also use localPositions

#

esp if the thing is a child object of anything

frank zodiac
#

thanks!

rocky canyon
#

balancing act for sure

swift crag
#

i had some messy scripts where I kept forgetting where, exactly, different things were happening

#

it was very tiring to work on them

grave frost
#

and XML comments?

rocky canyon
#

theres functions that are still a bit ugly imo..

#

but not sure how to make them better.. might just leave them alone

grave frost
rocky canyon
grave frost
rocky canyon
#

not sure what XML comments are.. but im pretty sure that 2nd one is what u mean

#

Summary is the only one i know about

#

also learned about snippets a while ago. and was going crazy with those 😄

grave frost
#

XML comments have a lot more cool thongs you can do when you do things like <code></code> and <see/> (the see tag needs more i forgot exact syntax VS always helps me auto complete it)

rocky canyon
#

i just recently started using VSCode.. soo not sure how to do it with it just yet but i know its possible.. b/c i installed a Unity Snippets plugin

frank zodiac
#

wrong video

rocky canyon
#

no if ur goal is a boomerang thats not it

#

the pingpong should do what u need it to..

swift crag
rocky canyon
#
        IEnumerator Rebound()
        {
            standby = true;
            float elapsedTime = 0;
            Vector3 startingPos = transform.localPosition;

            while(elapsedTime < upDuration)
            {
                transform.localPosition = Vector3.Lerp(startingPos,targetUpPosition,(elapsedTime / upDuration));
                elapsedTime += Time.deltaTime;
                yield return null;
            }

            transform.localPosition = targetUpPosition;

            elapsedTime = 0;
            startingPos = transform.localPosition;

            while(elapsedTime < downDuration)
            {
                transform.localPosition = Vector3.Lerp(startingPos,targetDownPosition,(elapsedTime / downDuration));
                elapsedTime += Time.deltaTime;
                yield return null;
            }

            transform.localPosition = targetDownPosition;
            standby = false;
        }
``` i use this for my headbob when the player lands.. it acts like a pingpong..
grave frost
frank zodiac
rocky canyon
#

i couldnt get pingpong to work correctly for it for some reason

swift crag
frank zodiac
grave frost
# swift crag e.g.

cref ahh. I was like ik its not href (although I think websites work too so you can use href with a link to unity docs for example)

swift crag
#

i'm just doing whatever VSCode suggested :p

grave frost
#

Why do so many people use VS Code? Never understood the draw.

rocky canyon
#

i made sure after i swapped IDE's

cunning narwhal
#

Sorry to ask whats gonna sound dumb, but, if I create a Unity project and then want to put it into a git repo with a gitignore on the first upload so I dont put in extra junk (gonna also use git lfs), how would I do this?

rocky canyon
#

so i figured i'd learn it as well

grave frost
slender nymph
rocky canyon
#

with enough extensions.. its pretty similar to Studio

frank zodiac
#
{   if (context.started)
    {
        weapon.localPosition = weaponStartingPosition;
        weapon.Translate(new Vector2(Mathf.PingPong(Time.time, 0.75f), transform.position.y) * attackVelocity * Time.deltaTime);
    }

    
}

is there something wrong with this? its not working like its supposed to

grave frost
rocky canyon
#

.gitignore always should come first

hollow dawn
#

@short hazel thank you for the assistance but I have a small problem. I still can't move but I can look around to the point where I can see my own body how can i fix this. sorry that I keep bothering you XD

rocky canyon
rocky canyon
#

before passing it into ur function

hollow dawn
cunning narwhal
#

I'll give that a go and parse out anything extra I'll need for the gitignore. Thank both! I think I may have a chicken and egg question coming up on if the repo is made empty then I move the entire project into it or what soon

slender nymph
short hazel
rocky canyon
grave frost
rocky canyon
rocky canyon
#

best to test the waters first

bronze mortar
#

Does anyone know how to create an animation where a card starts off transparent and lowered, but when you hover over it, it moves up and becomes fully visible?

cunning narwhal
#

Just one more thing on git repo stuff. So I created a new git repository locally and gave it a name. So now would I move my entire Unity project folder into that folder OR would I move all items within the unity project into that folder? Just trying not to break references and such

So I'd either have
A: My-Project\My Project{everything}
B: My-Project\{everything}

slender nymph
wintry quarry
grave frost
wintry quarry
#

e.g. you go into My-Project (the folder that has the Assets folder) and run git init there @cunning narwhal

slender nymph
#

or just copy the .git folder and other git related files right into the project folder

#

then it's just a matter of opening the repo with your preferred GUI

rocky canyon
grave frost
rocky canyon
#

i try to use MoveTowards.. to avoid the confusion.. so i dont get called Brackeys

bronze mortar
#

Okay! I'll just use @slender nymph's method

grave frost
#

Well I think SmoothDamp is better if you want smoothing, but MoveTowards works too.

rocky canyon
rocky canyon
bronze mortar
rocky canyon
#

ohh okay

#

ya, well if u wanna go that route.. go ahead and install and learn DoTween

slender nymph
#

my suggestion was also an all-code solution

rocky canyon
#

its a tweening library.. for all sorts of stuff

grave frost
rocky canyon
#

should be a bot command.. Use Code.

grave frost
rocky canyon
#

ohh okay 👍 just a suggestion.. but if ur working on ur own library do it to it

slender nymph
# bronze mortar [PI_happycat](https://cdn.discordapp.com/emojis/757709413753552996.gif?size=48&q...

DoTween or PrimeTween are some good tweening libraries and work very similarly. DoTween probably has plenty more tutorials available, although you could just do it yourself with a Lerp or MoveTowards, what you are attempting is incredibly simple to set up and doesn't necessarily require learning how to use a tweening library, but that knowledge would be handy down the line when you want to start doing more complex stuff or chaining different actions

rocky canyon
#

my library is bussin

short hazel
rocky canyon
#

y u exclude LeanTween 😈

slender nymph
#

because i, much like many others, forgot that it exists

rocky canyon
#

ahh okay.. probably my least favorite.. b/c DoTween has always been solid for me

#

just curious if u had a disliking for it

slender nymph
#

i didn't before, but now that i've looked at its documentation website i immediately dislike it. good lord that's some poorly formatted documentation

rocky canyon
#

anyone know what this assembly is for?

grave frost
#

Assembly-CSharp is the default assembly name that includes your scripts that aren't in a different assembly

bronze mortar
rocky canyon
#

but one of my projects keep recreating it and i wasnt sure what the -firstpass is

rocky canyon
grave frost
rocky canyon
#

i wanted to make sure it was unity's and not some third party asset creating it

slender nymph
slender nymph
faint sluice
grave frost
rocky canyon
#

okay.. yea im seeing it now..
my emptier project only uses 1 (the C-Sharp) one

#

but my fuller project keeps recreating the first-pass one..

#

just wanted to make sure it belonged 😄

grave frost
#

what I would like to know is why I get bloom by setting a color's value past (1, 1, 1) even with my global volume turned off lol... I don't remember that happening in the past.

cunning narwhal
# wintry quarry e.g. you go into `My-Project` (the folder that has the Assets folder) and run `g...

Did it this way and it works out :) For some reason when I di it through the gitdesktop application it likes to put the repo as a subfolder like "My Project\My-Project" instead of the intended "My Project" as-is with the .git folder within that.

I did come across an interesting thing on Git LFS and the "community recommended" gitattributes file from https://gist.github.com/nemotoo/b8a1c3a0f1225bb9231979f389fd4f3f in the comments where a user pointed out issues with line endings and binary files. Then someone wrote something up on that subject and posted it yesterday of all days which is nice https://www.chunfuchao.com/posts/unity-git-en/#gitattributes

rocky canyon
#

welp, i know what im doing this morning..

rocky canyon
#

been using it for 2 years now.. never looked back to github desktop

cunning narwhal
#

Oh nice, thanks yeah I'm always open to trying out something different

grave frost
rocky canyon
rocky canyon
#

thats probably my favorite part about it

grave frost
grave frost
#

oooh

rocky canyon
#

good stuff

grave frost
#

can't do that on source tree

rocky canyon
#

i try not to mess with it too often.. as im still very beginner to git..

#

when stuff breaks i go insane

grave frost
#

One time at work my local branch was behind my local branch and it wanted me to pull the changes to my local branch in order to push my local, unpublished branch :D

#

good stuff

rocky canyon
#

heres my most complex tree

#

this is where i like to stay

#

didnt even use git until i started making tutorials.. and then i needed to work ahead of my last version

grave frost
# rocky canyon heres my most complex tree

Solo project sure. The screenshot I sent was of a team of 10 people. It was extra chaotic because some people would just keep reusing their old branch instead of creating new ones.

rocky canyon
#

lol (╯°□°)╯︵ ┻━┻

#

i was a leader of a 5 man game-jam once..

grave frost
rocky canyon
#

took all of 12 hrs for the github to be broken to hell

#

we started passing around unitypackages

#

haven't worked in a team since 😅

grave frost
#

Well I have a suspicion that someone edited the gitignore or they placed a package in a place not covered by the gitignore

rocky canyon
#

got 500th place out of 3.2k tho

eager spindle
grave frost
#

Oh in my latest semester of college the opposing team told me "We kept getting conflicts with meta files so we added them to the gitignore"
Me: "THATS HORRIBLE-"
Them: "Yes, we quickly found that out"

eager spindle
#

Recently someone had to pull 220 commits 😴

rocky canyon
grave frost
rocky canyon
#

but eventually you need to go back a few steps..

#

and that i couldnt do.. so in comes github 🙂

eager spindle
grave frost
#

that sounds lovely

eager spindle
#

I already told them they should be making new branches but they didn't listen

grave frost
#

RIGHT

#

EXACTLY

rocky canyon
#

isn't there a way to have to approve pushes?

eager spindle
#

Our project is cooked and final presentation is this week

grave frost
#

They re-publish their local branch, bringing it all the way up the history from like 3 weeks ago. Like Creat. New. Branches. people

eager spindle
rocky canyon
#

so u can check for conflicts before it gets broken?

rocky canyon
grave frost
rocky canyon
#

i thought they give u lfs for free..

#

with a 100mb file cap

eager spindle
#

Tldr you disable pushing to main, ask your team to submit pull request, you approve pull request and it pulls

grave frost
eager spindle
#

🫡

bronze mortar
#

Yay, the animation works

eager spindle
bronze mortar
eager spindle
#

Very helpful

grave frost
rocky canyon
#

rekt

fluid kiln
#

Hi everyone! I'm working on a dialogue system for my Unity game and could use some advice. I need to manage dialogues with different triggers and conditions.

grave frost
#

Also to enforce checks, you need to pay for github premium or whatever they call it

rocky canyon
#

u can use a thirdparty asset to help u out

grave frost
fluid kiln
# eager spindle How may we advise you?

any tips?

I don;t know how to manage the "triggers" part, and appearently you can do that with the unity even system which i hate using, but i also don't wanna do a personalized script for everything "dialogueable" with a bunch of ifs (it sounds raw and newbie(?))

rocky canyon
#

something something.. Fungus

eager spindle
#

I have an overall Quest system, and nested in the Quest system are Quests which communicate with Dialogue system

eager spindle
#

ok one sec

eager spindle
rocky canyon
#

dialog assets ^