#💻┃code-beginner

1 messages · Page 273 of 1

swift crag
#

this class would just be a bag of data

ionic zephyr
stoic glen
#

Why does an animation event gets triggered, when the program starts?

swift crag
#

It will trigger the moment an animator plays through an animation that contains an event

#

even if the animation has a very low weight

#

(not sure about when the weight is literally zero)

stoic glen
#

How can I prevent it?

ionic zephyr
swift crag
swift crag
ionic zephyr
#

my idea is if(gameobject is "an specific character" and boost.doubleshoot) then code

swift crag
#
if (somebody == another) {
  // both variables refer to the same object
}
swift crag
#

then the character can decide how to change itself based on that data

swift crag
#

the graph view of all the animator states

ionic zephyr
swift crag
#

including whichever state has an animation in it that causes an event

stoic glen
swift crag
#

If you need to know if a character has a certain boost, just look at its Boosts object.

#

you can make it a public field on the character class

swift crag
ionic zephyr
swift crag
#

I mean an object of type Boosts

#
Boosts boost = new Boosts();
stoic glen
swift crag
#

boost is a variable that holds a reference to an instance of Boosts

swift crag
#

So that's the state the animator is going to start out in

#

If you don't want any animation to play at all at the start, create a new state that has no clip in it

#

then right click it and set it as the default state.

ionic zephyr
swift crag
#

well, presumably, you're going to do something like this

stoic glen
swift crag
#
public class CharacterDefinition : ScriptableObject {
  public string charName;
  public Sprite sprite;
  public Boosts boosts;
}
#

you set up the boost data in the inspector

#

just like you've assigned a sprite and set the name

#

then, you'll have...

#
public class Character : MonoBehaviour {
  public CharacterDefinition definition;
}

You can just pass the entire CharacterDefinition object to your character.

naive palm
#

Is it better to make base classes or static classes for cross script communication?

swift crag
#

check this out.

swift crag
naive palm
#

Well what I meant by communication is just like getting stuff from the main script

swift crag
#
void Update() {
  health += definition.boosts.healthRegen * Time.deltaTime;
}
naive palm
#

Just like the manager

#

For example enemy script and I wanna make multiple different enemies

ionic zephyr
swift crag
#

But most of them would have a healthRegen value of zero.

#

So that line would do nothing.

swift crag
#

If all of them need to talk to an EnemyManager (maybe something that keeps track of how many enemies have been defeated), then there are a couple of options.

#

you could give them a reference to the EnemyManager when you spawn them

#

or you could make EnemyManager a singleton that you access through a static field

ionic zephyr
swift crag
#

you'll see "Boosts" in the inspector for CharacterDefinition assets.

naive palm
swift crag
#

See the first link I just sent

#

it explains how you tell newly-spawned objects about things in the scene

naive palm
#

Currently anyway

#

But I’ll check the links

swift crag
#

It does not matter where the enemy manager is.

naive palm
#

Ty for help

ionic zephyr
#

yes but the thing is if I want that when a slider reaches maxvalue the player is allowed to use the boost (and I have that one character that has a double shot boost) then in my shooting script how could I make sure if it has reached it and, in the case I did (if (_value = _maxvalue) but I only wanted ONE character of the roster to have that hability how can I check that

swift crag
#

You can just give a reference to the newly spawned enemy.

ionic zephyr
naive palm
swift crag
#

still, it's pretty straightforward

naive palm
#

So I wouldn’t need to click and drag every time I make a new enemy

swift crag
#

each character should have a boost meter that doesn't really care what kind of special ability the character has

#

it's just a float

ionic zephyr
#

okay, I have that

swift crag
#

Ability systems are a very common thing people ask about, and they can be tricky.

#

The simplest option would be to just make an enum for the boost ability (without using the "flags" approach -- just a normal enum)

#

when you hit the boost button, you use a switch to pick which code to run

#
switch(definition.boost) {
  case Boost.HomingAttack:
    // turn on homing attacks
    break;
  case Boost.Speed:
    // double the player's speed
    break;
}
#

If you need to be able to store some configuration data, I'd just stick it into a class like this.

#

It will have lots of pointless data (if you have the Speed boost, your config will still have data for the Damage boost and the Health boost)

#

but that's not really a problem

ionic zephyr
#

boostActivated?

#

And how can I regulate the access to the boost depending on the character my player is

swift crag
#

If all characters gain boost in the same way, but just have different boost meter sizes, that can be a float on CharacterDefinition

swift crag
#

That way, they can manage their own data

#
IEnumerator HomingAttackBoost() {
  homingAttacks = true;
  yield return new WaitForSeconds(10f);
  homingAttacks = false;
}
ionic zephyr
swift crag
#

e.g.

ionic zephyr
#

the thing is

#

For example, one of my characters has a boost that allows to shoot a bullet that follows the target

#

and all of my characters have a shooting component

ionic zephyr
#

I mean

ebon robin
#

that does not affect the problem

#

shooting components are not static

#

they dont share datas

ionic zephyr
ebon robin
#

ok seriously you need to relearn some basics

ionic zephyr
#

Oh okay sorry

#

They arent static but the thing is every character has its instance of it

swift crag
ebon robin
#

every character has an instance of BoostBag and their BoostBag is different

#

you can easily differs

swift crag
#

Each character has a CharacterDefinition. a ChacterDefinition has a BoostConfig object on it (or whatever you call it).

#

None of the runtime data lives in BoostConfig (or anywhere in CharacterDefinition at all)

#

It's all read-only data.

ionic zephyr
#

for example

sinful bough
#

Hey guys, sorry for bothering you... But I am working on a game and I have successfully written a code to make a prefab (card) use an image stored in a specific folder (which I use for the card images). The code was working properly in my first project, but it got all messed up after I try to install LeanTween, I made a new project and copied all the scripts I was using there, but now I am getting an error with the script that loads the image of the card, it is making the right path, but somehow it isnt able to locate the images... Could somebody help me? hubintensfies

swift crag
languid spire
ebon robin
ionic zephyr
#

like overwatch for example

ebon robin
#

if its unique the just do a if statement to check if he has double shoot to do it

ebon robin
swift crag
languid spire
sinful bough
#

oooh.

ionic zephyr
sinful bough
#

Thx...😅

ebon robin
#

okay i dont think we re speaking the same language anymore, you need some professional help

swift crag
#

Every character will check if doubleShot is set to true

ebon robin
#

whats rude here, im being polite to tell someone else to walk you through this

swift crag
#

It's true that this system means that your Character class needs to understand how to use all of the different kinds of boosts.

#

Creating an ability system where all of the logic is stored outside of the character class is harder.

#

It's more flexible, of course, but I don't think it's necessary here.

ionic zephyr
ebon robin
#

an ability system stored outside of character class is simply impossible

swift crag
ebon robin
#

at least that unique class inherit from some interfaces, or base class

#

that calls the damm functions

ionic zephyr
#

okay, I thought it would be a little bit dirty that every character does that comprobation

ebon robin
#

delegates

#

dark magic

swift crag
#

yes, delegate types allow you pass entire functions around as data

ionic zephyr
swift crag
#

this is useful for creating complex behavior

ionic zephyr
#

is it useful for this habilities I am trying to implement?

ebon robin
#

yes

ionic zephyr
#

Okay lets see what spells I can learn

#

Thanks guys!

#

However, in order to make the roster, should I make each character a prefab?

ionic zephyr
ionic zephyr
swift crag
#

and also set up references

ionic zephyr
#

Okay, so it is a good idea then, thanks!

ionic zephyr
analog glen
#

Hello. Could someone help? Sometimes it starts to substract from x from gameobject very fast sometimes it works normally

eternal falconBOT
analog glen
honest trench
#

https://hastebin.com/share/ubazuboyag.csharp So this code should make it so when the player touches a object with tag Respawn, It decreases the alpha until it hits 0, sets the player to the lastCheckpoint, and puts the alpha back at 255. and it works great, until I touch the respawn again, which it doesnt do the Coroutine again

#

anyone know why?

austere monolith
#

!code

eternal falconBOT
honest trench
#

Yeah I used hastebin... is there a problem with that?

austere monolith
#

im using it for my own knowledge lmao

honest trench
#

OH lmao mb

austere monolith
#

np

wintry quarry
#

So won't it keep going forever?

#

With the way the outer loop condition is set up?

honest trench
#

Oh yeah I guess so

#

Ive changed it so it works everytime but it doesnt set the currentColors back to 255

#
    {
        
        Color currentColor = rend.material.color;
        Color currentColor2 = rend2.material.color;

        while (currentColor.a > 0)
        {
                currentColor.a -= 5f * Time.deltaTime;
                currentColor2.a -= 5f * Time.deltaTime;
                currentColor.a = Mathf.Max(0f, currentColor.a);
                currentColor2.a = Mathf.Max(0f, currentColor.a);
                rend.material.color = currentColor;
                rend2.material.color = currentColor2;
                yield return null;
        }
        // Alpha is now 0, set position to lastCheckpoint
        transform.position = lastCheckpoint;
        currentColor.a = 255;
        currentColor2.a = 255;
    }```
wintry quarry
#

you're not actually changing the renderer color

honest trench
#

but isnt currentColor = to the rendererColor

wintry quarry
#

it's just a Color struct

#

it's not related to the renderer

#

there's a reason you are doing rend.material.color = currentColor; inside the loop

#

without that, it won't affect the renderer

honest trench
#

should I move that to the end?

wintry quarry
#

it would need to be in both places the way you have this written

rich adder
#

isnt color 0-1 ?

wintry quarry
#

yes indeed

#

so it should really be 1 not 255

analog glen
wintry quarry
#

but it will work the same

honest trench
#

what If i defined currentColor in start

wintry quarry
#

you still want currentColor inside the coroutine

#

and at the end you can set the renderer color back to the normal color

honest trench
#

so define normalcolor as 255 and then set renderer color = normal color

wintry quarry
#

just do this

#
void Start() {
  normalColor = myRenderer.color;
}```
#

you don't need to hardcode any numbers

honest trench
#

telling me renderer does not contain a defenition for color

frigid sequoia
#

Just a overall doubt, I just learned about "enum" so I can just like give somewhat of a tag to something with if right? How is this different than just storing this information as a string?

short hazel
#

Plus, they're "lighter", as they're numbers under the hood

wintry quarry
#

sorry, as in your other code

honest trench
#

thank you

frigid sequoia
short hazel
#

Yes, they're both safer than using strings, and more explicit than using raw numbers (since you name them)

honest trench
#
    {
        Color currentColor = rend.material.color;
        Color currentColor2 = rend2.material.color;


        while (currentColor.a > 0)
        {
                currentColor.a -= 5f * Time.deltaTime;
                currentColor2.a -= 5f * Time.deltaTime;
                currentColor.a = Mathf.Max(0f, currentColor.a);
                currentColor2.a = Mathf.Max(0f, currentColor.a);
                rend.material.color = currentColor;
                rend2.material.color = currentColor2;
                yield return null;
        }
        // Alpha is now 0, set position to lastCheckpoint
        transform.position = lastCheckpoint;
        currentColor.a = normalColor.a;
        currentColor2.a = normalColor.a;
        
    }``` I set normalColor = rend.material.color, so I feel like this should be working but its still not reseting the alpha to 255 again
short hazel
#

You're not putting the color back into the material, like you're doing inside the loop

#

This is required as currentColor is a local variable which has no relation whatsoever to the material's color

honest trench
#

AH fixed it

#

that makes sense

#

thanks

fading rapids
#

what can be the cause of UI buttons workingh inconsistently(soemetimes when i press mybutton it isntantly works whuile sometimes i have to press it 10 times) the selected and hover effect of the button do get registered tho

queen adder
#

I am completely new to unity c#, can someone dm me

short hazel
queen adder
#

where should I learn unity and c#? there are bunch of different tutorial from different people and everyone uses different way/method to make something work, I am just confused, I want to follow one man who can teach and explain in one way.

eternal falconBOT
#

:teacher: Unity Learn ↗

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

pliant mist
#

This is a more general programming issue than just unity but I have the vector from the player to the mouse click lets say (350, -275) I need to be able to simplify that so the bullet only moves about 5 pixels a milisecond, I need to "normalize" the vector but I cannot have decimals for either value, how should I do this?

frosty hound
#

Unity has a normalize function for vectors

wintry quarry
#

I cannot have decimals for either value
Not possible to normalize a vector with these restrictions. unless it's facing in one of the cardinal directions

pliant mist
#

ok, what is normalizing? I want to build my own function

pliant mist
#

ty

frosty hound
#

Makes it a magnitude of 1

wintry quarry
#

normalizing a vector is getting a vector in the same direction but with length 1.

#

That's not possible with integer-only components except for the 4 cardinal directions.

pliant mist
#

okay thanks I'll see what I can do with that, I'm trying to make a game in VB for school, a bit of a pain

#

but I get to flex on people so it's worth it

queen adder
#

could someone give me first person script please

frosty hound
summer stump
eternal falconBOT
#

:teacher: Unity Learn ↗

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

queen adder
summer stump
queen adder
#

here

summer stump
#

Oh, you mean put yours script here? Ok, we can look at it

queen adder
#

finally you understand me

summer stump
#

I misunderstood one very vague thing you said

#

Which was in response to something I asked that you ignored

#

Have you gone through learn?

barren loom
#

is it normal to have mathmatica as one of the languages...?

short hazel
#

It's not uncommon for a single repository to have multiple languages

dreamy urchin
#

guys that's a variable in my movement script of my player and I'd want to access it from a script of a prefab, how can I do it? I already have the player object in my prefab's script, maybe it will be helpful someway

summer stump
#

Prefabs don't exist (they are just files; blueprints) so they can't really do anything

dreamy urchin
#

isn't that a script?

#

@summer stump

#

I mean idk, I'm still learning

summer stump
rare basin
dreamy urchin
summer stump
#

It shows every method. But yeah, never use Find()

#

It is never necessary

#

At the very least use FindObjectOfType, but even that should be avoided

gloomy bison
#

hey im making some dumb horse racing game on 2d. they all travel the same speed no matter what. the randSpeed 1 - 4 are set to random.range 10-30. They still move the same speed.
the code:

// IN START FUNCTION:
    randSpeed1 = Random.Range(10, 30);
        randSpeed2 = Random.Range(10, 30);
        randSpeed3 = Random.Range(10, 30);
        randSpeed4 = Random.Range(10, 30);

// IN FIXEDUPDATE FUNCTION
 Horse1.transform.position = Vector3.SmoothDamp(Horse1.transform.position, End4.transform.position, ref velocity, randSpeed1);
        
        Horse2.transform.position = Vector3.SmoothDamp(Horse2.transform.position, End3.transform.position, ref velocity, randSpeed2);
        
        Horse3.transform.position = Vector3.SmoothDamp(Horse3.transform.position, End2.transform.position, ref velocity, randSpeed3);
        
        Horse4.transform.position = Vector3.SmoothDamp(Horse4.transform.position, End1.transform.position, ref velocity, randSpeed4);

Please tell me where I went wrong because I'm really confused

short hazel
gloomy bison
#

my brains just not on haha. thank you

queen adder
#

guys this script has error but i cant fix it can someone help please try saying whats wrong with the script using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FirstPersonCamera : MonoBehaviour
{

// Variables
public Transform player;
public float mouseSensitivity = 2f;
float cameraVerticalRotation = 0f;

bool lockedCursor = true;


void Start()
{
    // Lock and Hide the Cursor
    Cursor.visible = false;
    Cursor.lockState = CursorLockMode.Locked;

}


void Update()
{
    // Collect Mouse Input

    float inputX = Input.GetAxis("Mouse X")*mouseSensitivity;
    float inputY = Input.GetAxis("Mouse Y")*mouseSensitivity;

    // Rotate the Camera around its local X axis

    cameraVerticalRotation -= inputY;
    cameraVerticalRotation = Mathf.Clamp(cameraVerticalRotation, -90f, 90f);
    transform.localEulerAngles = Vector3.right * cameraVerticalRotation;


    // Rotate the Player Object and the Camera around its Y axis

    player.Rotate(Vector3.up * inputX);
   
}

}

short hazel
#

!code

eternal falconBOT
queen adder
#

oh ok

short hazel
#

Use a code block or a paste website to post code, Discord interprets some characters for formatting

queen adder
#

oki

dreamy urchin
#

@summer stump that doesn't work, am I missing something

summer stump
#

Did you look up the docs?

#

Where did you get that from? It's a wild guess

dreamy urchin
summer stump
queen adder
dreamy urchin
summer stump
summer stump
#

That's not what it does

queen adder
summer stump
#

Ok best of luck then
I will remember you don't want help in the future

dreamy urchin
summer stump
#

First, you get a reference to the component instance

#

Which is what FindObjectOfType does

#

Then you use dot notation to access the variable from that reference

#

Look at the docs. It has example code

#

It tells you exactly what to do

lethal bolt
#

The bullets destroy stuff inseted of getting destroyed

summer stump
#

Not itself

dreamy urchin
summer stump
lethal bolt
rich adder
eternal falconBOT
dreamy urchin
rich adder
summer stump
#

The whole point of this discussion was to get you to not use Find. That was it

honest vault
lethal bolt
summer stump
#

Instead of collision.gameObject

I mean, there is a lot wrong with that code. But that one change will make the thing attached to that script get destroyed if it collides with something (ANYTHING) instead of the thing it collides with getting destroyed

novel dust
#

hey guys, im new to unity programming and trying to learn online. ive been stuck for the past 2 days trying to figure out how to assign these animations to an actual animator script, when i click on move lets say, i can see a preview of the move but when i write the code and finish the animator my character stays idle. can anyone help?

summer stump
carmine sierra
#

If I am making a turn based game, should I make each turn in the same scene and use two cameras for each player's area?

#

or should this be broken up into two scenes

#

for each player

rich adder
carmine sierra
summer stump
#

You could just use cinemachine to have it move back and forth easily, instead of two cameras

carmine sierra
#

i copied the function from a tutorial (added a bit myself) but i don't understand it's purpose for the inputfield

dreamy urchin
carmine sierra
#

it is toggled on the enter of the input

rich adder
#

I think doing FindObject once in awake is acceptable,
better than any of the string ones imo

rich egret
#

Hi I'm trying to convert a 3D model animation into a 2D animation, is it possible?

gritty wagon
#

Is there a cool mode to get a object to rotate inwards towards a point quicker and quicker?

#

I have found transform.RotateAround, but that is not really what i'm looking for

rich adder
gritty wagon
#

I'm looking for something like this

#

With the speed going up the closer to the middle

rich adder
summer stump
#

Referencing and dot notation are the absolute basics of c#, next to simply knowing what an int or bool are. So I recommend doing a c# course

#

And then maybe !learn

eternal falconBOT
#

:teacher: Unity Learn ↗

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

summer stump
dreamy urchin
dreamy urchin
summer stump
summer stump
brisk flume
#

I just have a question
to learn code should i just work on random projects and keep copying code till i memorize it
or should i put time learning the coding language alone

ivory bobcat
#

The Unity api or the c# language?

brisk flume
#

c#

dreamy urchin
languid spire
ivory bobcat
#

Are you coming from another language or are you entirely new to programming?

brisk flume
summer stump
ivory bobcat
#

I've got to run.

summer stump
dreamy urchin
summer stump
#

!learn will guide you @brisk flume

eternal falconBOT
#

:teacher: Unity Learn ↗

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

summer stump
#

If you want

plucky bear
#

!code

eternal falconBOT
brisk flume
plucky bear
#

I feel like I'm being inefficient with the constant if statements. Is this supposed to look like this or could I refactor something better?

    private void MoveSelectedCharacter() {
        bool hasCharacterOnTile = _gridController.GetNodeFromCoordinatePosition(_gridController.GetCoordinatePosition()).hasUnitOnNode;
        if (_battleManager.GetBattleState().Equals(BattleManager.BattleState.PlayerMove)){
            if (selectedCharacter != null) {
                if (selectedCharacter.IsSelected() && IsTileTraversible() && !hasCharacterOnTile) {
                    if (_gridController.GetNodeFromWorldPosition().isHighlightedForMovement) {
                        _gridController.RemoveHighlightFromTiles();
                        selectedCharacter.MoveCharacter(_gridController.GetWorldPosition());
                        Vector3Int characterPos = selectedCharacter.GetCharacterCoordPos();
                        _gridController.HighlightMovementRangeTiles(characterPos, selectedCharacter.GetCharacterSO().movementRange);

                    }
                }
            }
        }
    }```
spare trail
#

Hey everyone up and coming huge vr developer here. I need help generating a random number from blah to blah, and excluding a list of numbers i could add to... help is EXTREMEly appreciated k thanks

rich adder
#

you could potentially have an array of int and pick random entry

#

or do you mean add them as excluded after generating ?

spare trail
#

so im spawning spiders to random positions, and i dont want the same position twice

muted wadi
#

so im trying to make a gmod phys gun in unity and im struggling. I've gotten up to this point and tried a bunch of different approaches but im honestly not sure. Any ideas?

{
    if (fps.viewHit.rigidbody != null)
    {
        Rigidbody rb = fps.viewHit.rigidbody;
        rb.transform.position = 
    }
}```
spare trail
#

hence the exluding of random numbers 1-8 which is 1-8 emty game ob jects i use as positions

rich adder
carmine sierra
#

i know this is simple to execute but how would you go about making a toggle variable which dictates who's turn it is between two players

rich adder
#

when enemy has picked a point, remove it from that list so next spider wont have it in random index

carmine sierra
#

like i could do a boolean which is on (for p1 turn) and off (for p2 turn)

rich adder
#

isPlayerOneTurn = true

#

or make an enum

spare trail
#

@rich adder how would the points in the list look as vector3?

#

sorry im anoob

#

for now

carmine sierra
rich adder
carmine sierra
#

any idea what i could be doing wrong

spare trail
#

yeah i load in the gameobjects in the editor then get it in code like pos3.transform.position

rich adder
#

each time you take the spawn point , do spawnPoint.Remove(theChosenPoint)

muted wadi
#

serialisefield means its private but accessible through the editor

rich adder
spare trail
#

alruight thanks mate could i dm you if i need help

rich adder
#

weaponFired is the bool, it needs to be public yes

muted wadi
#

yeah but he can't access the bool if its not public right?

rich adder
rich adder
#

but the reference itself to WeaponFire script can be private

spare trail
#

word

muted wadi
#

oh right

#

yeah you're right

languid saffron
#

How would I go about make music fade out when I move away from it in 2D?

honest trench
#
    {
       
        if (collision.gameObject.tag == "Player")
        {
            source2.Play();
            StartCoroutine(moveWall());
            gameObject.SetActive(false);
        }``` Have this code on a stationary coin which when touching the player should play a sound, start a coroutine, and then turn off, but the collision isnt being triggered. I have no idea why
languid saffron
#

(I'm really new to game dev)

muted wadi
rich adder
muted wadi
#

@languid saffron

#

@rich adder hey if you're not too busy could i get your help with what i posted earlier?

rich adder
spare trail
#

@rich adder Transform Position1 = pos1.transform;
spawnPoints.Add(Position1); this good? at start()

#

also how do i add the black text for code

#

in discord

rich adder
eternal falconBOT
rich adder
spare trail
#
        spawnPoints.Add(Position1);```
honest trench
rich adder
#

is there a reason yuo're not linking thise gameobjects at runtime ?

carmine sierra
#

I feel like im doing something wrong, each slingshot and shop has it's own script. My current issue is I am not sure how i will manage dividing everything into two and needing to access each slingshot and shop's script individually

rich adder
carmine sierra
#

judging from the hierarchy what would you change

honest trench
#

Yes

#

I do

#

Rigidbody on the player

spare trail
# rich adder ` spawnPoints.Add(pos1);`

gives an error Severity Code Description Project File Line Suppression State
Error CS1503 Argument 1: cannot convert from 'UnityEngine.GameObject' to 'UnityEngine.Transform' Assembly-CSharp, Assembly-CSharp.Player C:\Users\Anthony\Unity Games\EscapeRoom2\Assets\SpawnSpiders.cs 28 Active

rich adder
spare trail
rich adder
spare trail
#

also ur helping two people at a time thats talent

rich adder
#

just put .transform

spare trail
#

ah

honest trench
rich adder
honest trench
#

Both the coin and player have colliders if thats what u mean

rich adder
#

lol

honest trench
#

oh lmao

#

And yea the player is tagged correctly

rich adder
honest trench
#

Player

rich adder
#

which one has the script you sent

honest trench
#

The coin

languid saffron
rich adder
honest trench
#

yes

muted wadi
rich adder
spare trail
#

@rich adder so how do i get a random spawn point for the spider? ``` float spawnNumber = Random.Range(1, 6);

if (spawnNumber == 1)
{
spiderSpawn.transform.position = pos1.transform.position;
spiderNumber -= 1;
spawnPoints.Remove(pos1.transform);``` this me rn

honest trench
lethal bolt
#

How can i add on the particle on inpact

muted wadi
rich adder
rich adder
languid saffron
muted wadi
rich adder
muted wadi
#

wut

rich adder
#

cannot convert Transform to Vector3

honest trench
#

still doesnt fire

muted wadi
rich adder
muted wadi
carmine sierra
muted wadi
#

that needs to reach the bottom at some point for the audio to not be heard at a certain distance

honest trench
#

this probably isnt what u mean but

languid saffron
honest trench
#

it doesnt appear

muted wadi
languid saffron
#

i can still hear it

muted wadi
#

that graph indicates the audio level over distance

rich adder
honest trench
#

oh okay

#

well any idea why it might not be working/any more info I can give u

rich adder
muted wadi
#

ah man navarone is on it

languid saffron
rich adder
languid saffron
spare trail
#

@rich adder spiderSpawn.transform.position = spawnPoints[randomIndex]; this giving me an erro

#

Severity Code Description Project File Line Suppression State
Error CS0029 Cannot implicitly convert type 'UnityEngine.Transform' to 'UnityEngine.Vector3' Assembly-CSharp, Assembly-CSharp.Player C:\Users\Anthony\Unity Games\EscapeRoom2\Assets\SpawnSpiders.cs 48 Active

muted wadi
spare trail
#

❤️

rich adder
#

you need to get its property .position if you want v3

honest trench
ionic zephyr
#

if I want to register the target transform for my bullet but without relying in the editor to assign it

rich adder
rich adder
honest trench
#

let me just hastebin my code navarone

ionic zephyr
honest trench
rich adder
ionic zephyr
rich adder
ionic zephyr
honest trench
tender stag
#

how can i move the root bone of two bone ik constraint with the tip still working?

rich adder
tender stag
ionic zephyr
honest trench
#

wait navaroen I sent the wrong pastebin

#

hold on one sec im sorry

rich adder
#

depends on many things
like if you're doing a ray you can already find target

honest trench
#

okay this is it

#

I had some code that was doing absolutely nothign

rich adder
#

and use OnTriggerEnter2D

honest trench
#

alright let me try that

#

wouldnt i have to put the script on the player

#

then

rich adder
#

if it has rigidbody it can calls it both colliders

honest trench
#

oh ok

rich adder
#

make sure its dynamic lol

#

I only used .MovePosition with kinematic thats why I got confused

honest trench
#

okay it worked

#

kinda

#

theres some issues but its better

#

ill probably be back in here in liek 5 minutes lmao

rich adder
honest trench
#

the audioSource isnt playing

rich adder
honest trench
#

and also my coroutine is just not done right cuz i suck at them

#

it isnt

ionic zephyr
honest trench
#

heres this to help if u need

rich adder
honest trench
#

navarone

ionic zephyr
rich adder
rich adder
brazen canyon
ionic zephyr
honest trench
honest trench
#

it sets off the moveWall and it sets the coin to be not active

rich adder
ionic zephyr
tender stag
#

how do i change the root's position without affecting the rest of the ik?cs private void LateUpdate() { leftArm.position = targetRightArmPosition.position; rightArm.position = targetLeftArmPosition.position; }

#

u can see in the video

#

that it moves the whole arm now

#

and the ik doesnt go to the target

#

i just want to change the root's position and not its children

rich adder
ionic zephyr
rich adder
ionic zephyr
honest trench
#

i just have no idea why the audio source isnt playing

rich adder
rich adder
ionic zephyr
rich adder
ionic zephyr
#

yeah but the thing is

#

Should I make my characters of the roster prefabs?

#

so they can be instantiated whenever fight starts

#

or should I make two game objects already in the fight scene?

rich adder
#

how would you have two things in the scene that aren't chosen yet

#

unless you have some blank prefab then load the player data like an SO

ionic zephyr
rich adder
ionic zephyr
#

okay thanks

ionic zephyr
ionic zephyr
#

because prefabs are in assets, not in Scene?

rich adder
ionic zephyr
#

Okay thanks, now I get it!

scarlet skiff
#

why does sineWaze make the movement so extreme even if waveDensity and intensity are at something very small like 0.1

#

the obejcts beign scattered

carmine sierra
#

I dont know if it is okay to use the same two scripts twice on two separate objects

wintry quarry
scarlet skiff
#

thanks i figured out tho, here is the new code for those who r interested

unique kestrel
#

I've decided to create a fresh project with the simplest form of the thing I had an issue with to isolate the source of the problem

#

changing the position of an object through script isn't working for me for some reason

frosty hound
#

Show your code?

scarlet skiff
#

how on earth are they still falling (although very slowly) if their gravity scale is 0?

scarlet sail
#

kinematic only lets code affect the movement of the objects instead of dynamic, dynamic allows gravity and code to affect objects.

polar acorn
unique kestrel
#

no

polar acorn
#

Show code then

unique kestrel
#

it's a UI Image

polar acorn
#

!code

eternal falconBOT
unique kestrel
#

ok on sec

#

so I got it working in a fresh project but Idk why it's not working in my main project

#

here's the code

summer stump
#

A lot of important info is cut off

unique kestrel
#

yeah

polar acorn
#

I don't think they've shown any images yet

#

unless it was a while ago

summer stump
#

Oh dang. Mixed them up with obada

#

My bad

unique kestrel
#

what counts as large code block

#

lol

summer stump
polar acorn
#

If you have to ask, that

unique kestrel
#

didn't mean to comment the update line

summer stump
polar acorn
unique kestrel
#

yeah MoveCardHovered doesn't work properly

#

this is the debug log from the positions

polar acorn
#

So, if you put this log after setting the position, does it display the same value for both?

unique kestrel
#

they are the same after setting (as they should be)

polar acorn
# unique kestrel

Okay, then it's pretty clear something else is moving it after this function runs

unique kestrel
#

something resets the position before the next frame

frosty hound
#

Do you have an animation on the object you're moving?

unique kestrel
#

I do

frosty hound
#

Does the animation have a position property on it?

unique kestrel
#

yes

frosty hound
#

Then it's the reason why you can't set the position in code

unique kestrel
#

even if no animations are playing?

frosty hound
#

How are you verifying that it isn't?

#

Is it the default animation in the animator?

unique kestrel
#

I don't have any properties changed on the default

frosty hound
#

Are you sure it's the one playing? Have you run the game and check the animator to see which animation is actually running though?

unique kestrel
#

i'll double check the animator during runtime

frosty hound
#

Either way, code not moving something means something is overriding. Most cases, it is an animation running, otherwise, you have code resetting it elsewhere

unique kestrel
#

gotcha, thanks for the help

scarlet skiff
#

how does one change the value "0.7" via code?

unique kestrel
#

@frosty hound Would a Grid Layout Group effect the position if I Instantiate a copy of one of the child objects in the grid layout group but as a child object of another canvas? I was under the impression the only time the position was driven by the Grid Layout Group was when it's a child object of the GameObject with that component.

#

also if the ping is inappropriate lmk I'm new to this way of getting help

frosty hound
#

Well, that canvas would be part of the layout group

summer stump
polar acorn
unique kestrel
#

this is the object with the grid layout group

#

the display canvas is where I instantiate the clone

#

I'm going to run through all my scripts and make sure it's not some of my code driving the position

#

does anyone know how to use a field watch in Rider?

#

if I could watch the position after my code I could potentially see what code is changing the value

#

I tried googling this but the answers were not clear on whether this is possible or not

scarlet skiff
#

is there a reason as to why i cant drag the animation called "HeartIdle" into the "anim" section of the script component?

wintry quarry
scarlet skiff
#

damn what the hell is an Animation then

#

ok so

#

i just added an animation component

#

dragged the clip in there

#

then draggen the component into that slot in the ss

#

thats how its supposed to be done?

polar acorn
#

You shouldn't use the Animation component. You should use the Animator

#

Animation is a legacy system. It may seem easier but once you do anything more complex than playing one animation straight through it's gonna get more complicated

scarlet skiff
#

so through the animator i get the right animation clip with some code

wintry quarry
scarlet skiff
#

i followed the docs sent above somewhere

wintry quarry
#

If you're using Animator generally there's not a good reason to reference an animation clip

wintry quarry
#

In the state you can set the speed to be read from a parameter

#

Then you set that parameter from your code

#

No reason to reference any clips

scarlet skiff
#

so id use a float parameter?

#

cuz im already using a bool parameter

wintry quarry
#

Yes

scarlet skiff
#

for when the animation should be played

wintry quarry
#

You can use multiple parameters for different things

scarlet skiff
#

alright ill try to cook

#

i do set the animator.SetFloat("HeartIdleFloat", 0.4f); correectly ig

#

but idk how to use that to then set the speed of the animation to the value of the float parameter

polar acorn
compact crescent
#

Hey, can anyone help me out with this? So I downloaded probuilder in unity but it doesn't show the tools tab after I downloaded it, anyone know how to fix it>

sterile wraith
#

Hey guys. I’m working on an interesting project simulating cars precisely. So, I have a function that runs and matches up the rotation of the wheels to the speed of the car and vice versa (I’ll take slip into consideration later), but my problem is that when cars steer, the car rotates a little bit as you turn. But in Unity, since I’m custom programming the rotation and movement of the car, I also have to code the rotation of the car. What’s the best way to go about the steering?

compact crescent
teal viper
#

And if so, do you have any compile errors?

compact crescent
#

It's just supposed to add a tools bar after being downloaded.

nimble apex
#

when you drag the scroll rect, there should be a value indicating how much u dragged , whats that?

#

should be a normalized value?

teal viper
sterile wraith
compact crescent
teal viper
compact crescent
summer stump
summer stump
#

It will open it

compact crescent
#

OH

#

Yes, I do

teal viper
#

Well, you'll need to fix these errors first.

compact crescent
#

Ok, I'll try 1 sec

#

How do you fix the red ones?

teal viper
#

You read the error message, understand it, check the code that throws it and fix accordingly.

compact crescent
#

Alright.

summer stump
#

The red ones are errors

#

Yellow are warnings

#

Grey or whatever are just logs

sterile wraith
#

Is there any way to constrain one gameobject to 4 others

#

Cause I want my wheels to move when I’m steering and I want the chassis to follow along like a normal car

teal viper
#

Use wheel collidersthinksmart

faint osprey
#

im getting this error on my scene switch script

Cannot load scene: Invalid scene name (empty string) and invalid build index -1
UnityEngine.SceneManagement.SceneManager:LoadScene (string)

    {
        SceneManager.LoadScene(SV.currentScene);
    }``` thats the function that makes the game reload the scene and SV.currentScene is a variable on a scriptable object that is assigned a value on start
teal viper
sterile wraith
summer stump
sterile wraith
#

My biggest problem though is chassis rotation

#

I haven’t come up with any solution

#

My only idea was to calculate the ackerman center point and instantiate a gameobject and rotate around it but that doesn’t seem pretty efficient

teal viper
sterile wraith
#

And game developed a lot

faint osprey
# teal viper What value does it have assigned?

i found the problem its that it isnt being assigned to the variable on start ``` public int sceneIndex = 0;
public string currentScene;
public string[] Scenes;

// Start is called before the first frame update
void Start()
{
    currentScene = Scenes[0];
}```

thats how i try to assign it but that doesnt work for some reason

teal viper
radiant glen
#

Any easy way to stop the "glitch" that I am seeing in the video, basically I have a dialoge system where when you hit a box collider it starts but if you leave and reenter it makes that weird visual thingy and I couldnt think of a good way to stop it, there is my code as well. Ideally it just restarts every time you enter and loses the first bit of text if that makes any sense. Any ideas would be greatly appreciated thanks!

faint osprey
# teal viper Debug

yeah its causing an error where i assign the variable cause no debugs print to the console after that statement thats a pic of the array being set in the editor but for some reason it doesnt want to assign to that variable

faint osprey
teal viper
#

All the details(including the call stack)

#

Take a screenshot

faint osprey
teal viper
#

Expand it a bit more

faint osprey
clear locust
#

Hi, I need your help guys.

Im making a quiz game and the score system doesn't seem to work. The text should display "00" and when the player picked the correct answer, it should add 1 to the text, so it should be "01". What code should I add

Here's the scripts:

north kiln
#

!code

eternal falconBOT
stray pivot
#
you have to past your code like this

north kiln
#

They should link to their code, as it is large.

clear locust
#

yeah i cant paste it LOL mb

#

Here, pls help me cuz its for my project and I'm really struggling with the increment

teal viper
# faint osprey

Hmm... This error is probably unrelated. Does it happen again if you clear the console and launch the game?

clear locust
upbeat root
#

I am really struggling to get something i imagine should be simple enough to do
Basically, when the player controlled tank destroys a mysterycrate with its bluerounds, 1 of 3 random effects should occur
1Crate explodes and damages thing nearby
2tank and blue rounds get bigger and faster and do more damage for 10-15 s3conds
3. Player tank recovers 10 durability(health)
Anyone able/willing to help?

This is for my final game design course project, due soon, and i still need to add difficulty settings and ui TnT

karmic mulch
#

yo someone help my player is fading through textures

#

oke i change speed

#

and its works

steady stone
upbeat root
steady stone
#

like this

#

helps you map out all your references and objects

#

designing a system with nothing but your brain is impossible

#

for example

nimble apex
#
  void Update()
  {
    if (!isInit) { return; }

    if (!isExecuted)
    {
      float dragThreshold = m_recycleScrollRect.content.rect.height * 0.05f;

      if (m_recycleScrollRect.content.anchoredPosition.y < -dragThreshold)
      {
        StartCoroutine(test());
        isExecuted = true;
      }
    }
  }

  IEnumerator<WaitForSeconds> test()
  {
    Debug.Log($">>> parsed");
    yield return new WaitForSeconds(1);
    
    m_history = m_history.OrderByDescending(m_history => m_history.updateAt).ToList();//sort by descending
  }```

is there any ways to do the same thing without using update at all?
teal viper
nimble apex
#

this code is to simulate modern app scrolling

nimble apex
#

im asked to do the same thing to the UI

#

however, this UI does not even have a scrollbar, so you cant use verticalscroll.value

edgy vine
#

This is less code but more unity stuff

nimble apex
#

test() is the function for refresh

teal viper
edgy vine
#

but with complex animations do you have to have a trigger for each individual Transition?

teal viper
#

Otherwise, no.

edgy vine
#

Mhmm

#

Maybe I can explain it like this

#

Lets say in the code

#

if they press W I want them to go forward

#

I odnt care what state they are in

#

just get them moving forward

#

But if I set all of the conditions on each transition to walk what one will it use?

summer stump
edgy vine
#

Will it use the one it was in last?

#

OH shit

#

theres an animation tab

#

I zoom there

teal viper
nimble apex
edgy vine
#

Oh okay

#

so If the current state is walking

#

it would go from walking to idle no matter what

#

even if another transition uses the same trigger?

teal viper
teal viper
edgy vine
#

Okay thank god

#

i just wanted to make sure

#

Thank you guys so much

nimble apex
#

ok ty

#

i think i gonna do it after my lunch lol

edgy vine
#

Lunch?

summer stump
sick star
#

In the update function, everytime my ray hits the ground I want it to lerp between feet.transform.position and hitpos. How could I do this?

#

the code works but I just want to implement lerp (i tried and it failed horribly)

summer stump
#

But this helps with lerp, one sec

sick star
#

alot easier than lerp lol

nimble apex
# edgy vine Lunch?

in east asia, we have breakfast (6am-10am) , lunch (11am-2pm) , and dinner (6pm-8pm)

#

we also have midnight snack(meal) tho

#

breakfast is super light meal, dinner eats the most

#

i guess lunch is more like a brunch in european countries?

unique kestrel
#

update on my problem:

  1. Animator component changes the position of my object after I change it each frame
  2. I'm not sure what part of the animator is doing this, the default state doesn't have an animation
  3. Does an Animator component force positional values even after an animation finishes playing? (it's not set to loop)
#

doing further investigation

gritty wagon
wet tendon
#

Hey, I have a minor beginner doubt regarding C#.

So, I was working on a small game for my first game. It's a flappy bird game. Here's the update function

    void Update()
    {
        myRigidBody.velocity = Vector2.up * 10;
        print(Vector2.up);
    }

Here, is the Vector2.up always constant? It's always (0, 1) when I print it.

keen dew
swift sedge
#

It's the green/Y component of the vector in world space

#

So it will be 0, 1

#

So yes, because it's world space and not object space, it will always be constant. If it's object space, then it will also be constant unless a force or rotation is applied

carmine sierra
#

I uploaded my game to dropbox so i can access it on another computer but it skipped some files as they were deemed as empty

#

could this affect the upload at all

swift sedge
#

what folder were they in

carmine sierra
#

idk but they are of the file type rsp2 and mvfrm

carmine sierra
#

if dropbox says they are empty surely they are empty right

swift sedge
#

Which fill up on runtime

#

But cache can be deleted

carmine sierra
#

okay cool

#

also i just uploaded the self titled folder of the game

#

should i also upload the data folder

swift sedge
#

If the game runs, then it works

carmine sierra
#

ok thanks

carmine sierra
#

or is ther not enough context

wet tendon
wet tendon
#

Thanks. Got it.

#

Ohh yeah, forgot it's open source lol.

cosmic dew
#

Assets\Scripts\Purchaser.cs(9,45): error CS0535: 'Purchaser' does not implement interface member 'IStoreListener.OnInitializeFailed(InitializationFailureReason, string)'

eternal falconBOT
burnt vapor
#

The easiest fix is to define the method in this case and leave it empty, but that's obviously not the point.

cosmic dew
#

sorry but i did not understand

burnt vapor
#

Then consider learning how interfaces work in c#

exotic hazel
#

How Do i access depth of field and motion blur in script?

burnt vapor
exotic hazel
#

lemme see

rare basin
brazen canyon
#

Hey guys

#

I have a parent class

#

I have 2 classes inherit from this class

#

Now I put a list in the parent class to store whatever collided with the 2 classes (game object).

#

So will these classes share 1 single list or they still store stuff in 2 different lists ?

burnt vapor
#

If you want to share the list, you can make the list static to avoid it being part of an instance.

#

Then it will be a single list. Note that this means the list will always exist and in the event a class is removed or destroyed the list will continue to exist.

#

A better idea would be to have a general shared class that holds the list, and have the classes access its data. Then you can share the list.

exotic hazel
burnt vapor
#

Find type methods are kind of like reflection in c#. You have a general method to find anything in the application, but it is incredibly slow to do something like this. It's also very prone to errors if you try to find by string or in general because if the result does not exist it's not clear why.

#

There are better ways to find what you want. If you have a single instance of something, and I assume that's the case here, then perhaps also try accessing it by singleton: #💻┃code-beginner message

#

Singletons are not always the answer but if you're certain you will only ever need one instance you can use this.

exotic hazel
burnt vapor
exotic hazel
pliant mist
#

I'm doing atan(y/x) to fid the angle from the center

#

I don't know what is wrong with that but it returns a decimal every time

#

math checks out wth

teal viper
#

What's your expectation and what actually happens?

eternal needle
#

whats up with those equations at the bottom too 🤔 were you trying to get rid of the 1 as a denominator

eternal needle
craggy lava
#

I would like to ask how i would calculate if there is a wall in front of my enemy so it will take another route to get to the player under here is the Enemy script and the target Transform is just the Player

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

public class Enemy : MonoBehaviour
{
    [SerializeField]
    private Transform target;

    [SerializeField]
    private float speed = 2f;

    private float minDistance = 1f;
    private float range;


    void Update()
    {
        range = Vector2.Distance(transform.position, target.position);

        if (range > minDistance)
        {
            transform.position = Vector2.MoveTowards(transform.position, target.position, speed * Time.deltaTime);
        }
    }
}
teal viper
languid spire
craggy lava
#

I have only played with Navmesh in 3D

languid spire
#

but still a damn sight easier and better than trying to do it yourself

craggy lava
languid spire
#

yes, I would

craggy lava
languid spire
#

wait, no

craggy lava
languid spire
craggy lava
craggy lava
languid spire
craggy lava
low tide
#

Guys how do i make a grid based movement

craggy lava
cosmic dew
#

i want to add IAP to my game. Any tutorial or documentation

craggy lava
languid spire
craggy lava
hidden sleet
#

I've been talking to some folks on the unity forums, and they said you can actually create scriptable object instances at runtime. Given that, would that make it possible to use SOs for randoml generated items that you can't possibly define before running the game?

languid spire
craggy lava
languid spire
cosmic dew
#

i want to add IAP to my game,but i dont know how to it?

cosmic dew
#

Assets\Scripts\Purchaser.cs(9,41): error CS0535: 'Purchaser' does not implement interface member 'IStoreListener.OnInitializeFailed(InitializationFailureReason, string)' . i tryed but this error is coming

hidden sleet
#

Actually, thinking about it now, one of the reasons I'm even using scriptable objects is so I can give items a prefab that they can spawn into the world using, since I can just drag and drop it through the editor. Is it possible to do that with regular classes too?

#

and if I instantiate a scriptable object at runtime for a randomly generated item, I won't be able to drag that prefab in the object, so i may have to do it in code

languid spire
cosmic dew
languid spire
# cosmic dew whats the missing interface

not missing interface, missing interface method. This one, as clearly stated in the error message
'IStoreListener.OnInitializeFailed(InitializationFailureReason, string)'

cosmic dew
languid spire
wraith valley
#

Lol, what?

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

public class GameManager : MonoBehaviour
{

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

    // Update is called once per frame
    void Update()
    {
        
    }

    public void Exit()
    {
        Application.Quit();
    }
}
wintry quarry
#

You dragged the wrong thing into the slot

#

Drag a GameObject with the script attached to it into the slot. Not the script itself

wraith valley
#

Should i create gameObject(prefab) to scene?

hidden sleet
#

if I change some parts of the scriptable object script, do i need to create a new asset for it to update?

wraith valley
#

Thanks

#

Strange rule

wintry quarry
wraith valley
#

Ok

#

Practice

hidden sleet
#

good good

wraith valley
#

That`s changed to script

#

Is not prefab

wraith valley
#

Does it work?

#

Lol is working

#

But exit don`t

hidden sleet
#

getting an error I've not seen before, but double clicking doesn't actually take me anywhere

rare basin
#

literally the second line of the description

wraith valley
#

Shut down the running application. The Application.Quit call is ignored in the Editor.

#

Lol

quartz granite
#

how do i save my game so then i can covert it into zip and sumbit it into the dropbox

woven crater
#

hmmm why i cant reference my asset?

languid spire
woven crater
#

okie

dim bridge
rare basin
dim bridge
#

and run sudo rm -rf /

languid spire
wraith valley
#

Deleting system

#

Good idea

dim bridge
woven crater
languid spire
quartz granite
woven crater
languid spire
# woven crater

the important word there is 'relative'. Any folder used in Resources.Load must be relative to a Resources folder

hidden sleet
#

So I've got myself some inventory scriptable objects created, however I can't actually see their contents. My base inventory script is generic and these are more concrete types, but is there something I'm missing to properly see their contents?
https://hastebin.com/share/erobetajog.cpp

hidden sleet
#

Since I've got a generic inventorySO script, with subclasses that inherit it and declare the type, then those become assets, is that why?

craggy lava
#

I am playing with NavMesh in 2D but it does not work since there isnt a navmesh also after i have baked there still isnt a navmesh

#

This is how my hierarchy looks

wintry quarry
craggy lava
wintry quarry
#

Then you can't use navmesh in 2D

craggy lava
wintry quarry
#

Navmesh is for 3D only

craggy lava
#

Oh

wintry quarry
#

Unless there's something I don't know

teal viper
#

Well, you can fake 3d for the navmesh, but yeah, it's not intended to be used in 2d context.

craggy lava
#

Then i will try and use NavMeshPlus

little seal
#

im new to unity and game making in general, im trying to make a conveyor and put a 2d collider on my object and one on my conveyor.

    private void OnCollisionStay2D(Collision2D collision)
    {
        print("collided");
        
    }```
this is in my conveyor script for now, issue is it doesnt print anything
i tried giving the object a rigidbody2D which didnt work
the is a child of a gameobject (the child has the collider and the parent has one as well but for a different purpose)
#

the collider of the parent doesnt work for its purpose either

wintry quarry
#

And both objects need non trigger colliders

little seal
little seal
wintry quarry
wintry quarry
#

Kinematic is not for removing gravity

#

It must be dynamic

#

If it's a trigger there's no collision

little seal
#

oh

wintry quarry
#

If it's kinematic, there's no collision

#

OnCollisionEnter2D is for collisions

little seal
wintry quarry
#

Triggers are to have no physical collision

#

Just the ability to detect the overlap with OnTriggerEnter2D

little seal
#

oh then ig i just used the wrong collider

snow socket
#

hello, does anyone know why my Pretest and Posttest scene wont appear in the build settings? ive already pressed "add open scene"

young spindle
#

Hello, is there a way to get the rotation values of an object that are equal to the ones in the inspector that also works in builds. I know that there is this: UnityEditor.TransformUtils.GetInspectorRotation(gameObject.transform), but it doesn't work for builds.
I am currently using "transform.rotation.eulerAngles", but those values only go from 0 to 360 so they do not show how often the object rotated around itself.

swift crag
#
 m_LocalEulerAnglesHint: {x: 0, y: 23555, z: 0}

This is stored in the serialized data. I'm not sure it's going to exist in the built game at all.

buoyant perch
#

errr help im trying to donwload like the tutorial projects from unity learn but i dont know which version it is i just downloaded another editor and im still getting this

young spindle
keen dew
#

The Euler angles in the inspector aren't mean to be used that way. If you want to track the number of rotations you'll have to make your own Vector3 variable and use that instead

young spindle
#

ok interesting I'll do it like that. Though i think there should be a way to get the values that are shown in the inspector. would make it a bit easier

swift crag
snow socket
queen adder