#💻┃code-beginner

1 messages · Page 790 of 1

slender nymph
#

it's literally saying it's null right there in your log

golden notch
#

the second one not the first, there are 2 Daug.Logs

slender nymph
#

you've proven that the Find was successful. not that the variable is not null. based on the fact that the variable is null but Find is returning an object, what do you think that means

golden notch
#

it's not finding the component?

#

but the component is there

slender nymph
#

prove it

golden notch
slender nymph
#

now prove that is the only object in your scene with that name

golden notch
#

it's the only one in that slot

zenith cypress
#

well it's transform. so it will be among the children (not scene wide)

slender nymph
#

ah, right. that was a mistype on my part

golden notch
#

the strange thing is it works exactly one time

#

then it's null

slender nymph
#

either you have more than one object with that name where at least one of them does not have that component on it, or the component is being destroyed. assuming that "it works exactly one time" is actually accurate (the logs you showed before showed it was not)

golden notch
#

ok

olive igloo
#

Guys I have problem TextMeshPro InputField caret shows but typed text not visible like the input is there but the text just does not show can somebody please help me

golden notch
#

when i comment out .SetSlot(), it works fine

slender nymph
#

well yes, you won't get any exceptions if the code that was throwing the exception is simply not called

#

much like how you won't end up at the grocery store if you never get on the road that leads to the grocery store

zenith cypress
#

Start probably hasn't run yet. I know in my other project I abuse Start on spawns since it runs at the end of the frame (I think another case it is different, idr), while Awake is instant.

naive pawn
#

you won't get lost in the grocery store if you don't enter the grocery store

golden notch
#

you know what imma use the inspector to define it

slender nymph
#

but yes, as Nomnom pointed out, it is unlikely that Start has been run at this point. if the objects are all part of the same prefab though you should just be assigning the variable in a serialized field instead of relying on Find().GetComponent

golden notch
#

wait...

slender nymph
golden notch
#

ok i changed OnStart to OnAwake and it's working now

slender nymph
#

why not just assign it in the inspector instead since that's still the better option?

golden notch
#

i am instantiating new blocks

slender nymph
#

but it's using transform.Find which implies that the object is a child object which means it has to be part of the prefab already, no?

golden notch
#

i guess each instantiated piece can have a link to it's own thing

slender nymph
#

that's what i'm saying

olive igloo
#

can somebody please help me sobpraying

slender nymph
#

was your question a code question?

slender nymph
#

yes i am aware.

golden notch
#

oh

slender nymph
cunning narwhal
#

So I'm working on an asset and am testing compatibility and going to work through any api issues for older versions. Which Unity LTS versions should I be looking for? I was half expecting to just see 1 LTS version for 2021, 2022, 6000 etc. but instead its many many LTS versions

#

How do I know which to target for a general audience?

naive pawn
cunning narwhal
cosmic oyster
#

does anyone can help me with some enemy and shooting code?

#

basically i need rayHit.collider.GetComponent<ShootingAi>().TakeDamage(damage);
and i dont know how to do it and i cant find anything online

#

its a 3d built in pipeline

#

if u guys know how to do it pls reach out to me on my dms

naive pawn
naive pawn
#

you lose all the benefits of having a community server if you delegate to a private/ephemeral space like DMs or VC

cosmic oyster
#

okok

golden notch
#

is there a way i can get the asset file path? not the streamingasset file path?

#

or do i need to put everythign into a streamingasset folder?

golden notch
#

so i need to do streamingassets folder then?

rich adder
golden notch
#

i want to make a default file structure like:
avatars, itemdefs, textures, materials, etc.
I am mainly only needing to use itemdefs to load in, and the rest i need a way to check if the file exists

grand snow
#

^ Correct. Asset path is only useful in editor when using AssetDatabase

#

EDITOR ONLY

golden notch
#

how do i do game asset path?

#

like reading a json file

#

or checking if a texture exists

grand snow
#

you do file io with the File class

#

e.g. File.ReadAllText(Path.Combine(Application.streamingAssetsPath, "stuff", "thing.json"))

#

You need to create the path dynamically like in the example above. using something like Path.Combine is the best

golden notch
#

assetsstreaming means i need to put them in a "Assets/StreamingAssets/" folder, what all goes there?

grand snow
#

files you want to access in editor and in builds

#

a texture you want to use should not go there

#

I think you may be confused what its for

golden notch
#

yeah what is it for?

#

all i wanna do is load a json file from "Assets/Itemdefs/"

grand snow
#

Unity explain its purpose but its for generic files that are NOT unity assets that we want to access in a safe location

slender nymph
shell sorrel
#

really just use a TextAsset and drag in the reference to it

#

or load via addressables if you want to do it via name or path or something

golden notch
#

imma be having tons of these textassets

#

they are item definitions

slender nymph
#

is there a reason they are json files and not scriptable objects? like, are they premade and you're just importing them?

golden notch
#

i want to eventually allow people to make their own item defs (moderated of course)

shell sorrel
#

then addressables or streaming assets

golden notch
#

addressables?

shell sorrel
#

its a way of bundling game content

#

it also lets you load stuff via tags or paths as well

#

also lets you do stuff like downloadable content works for pretty much all asset types by code

golden notch
#

oh nice

shell sorrel
#

is a bit of a learning curve though

#

simpliest way forward is streaming assets folder or textasset and drag it in

grand snow
#

addressables would mean players must use the unity editor to modify content

#

By default everything uses assetbundles

shell sorrel
#

yeah streaming assets will just have the assets in a folder unpacked

#

this would compile it all to .assetbundles

grand snow
#

(can be changed but may be a bit advanced)

shell sorrel
#

bundles or addressables are also a important thing to learn about when you get to larger games and need more control over what is loaded when

golden notch
#

which would be better, bundles or addressables?

rich adder
#

learn both and see which one suits your situation for now

golden notch
#

is there a simplified way of saving objects to a file of any kind? Like saving a gameobject and its components and settings?

rich adder
#

serialization

swift crag
#

Addressables is a wrapper around the existing AssetBundle system, so you're using 'em either way 😉

golden notch
#

is there a programatic way to do textassets?

grand snow
#

they are just text files with extensions unity recognises

#

so you can make files with c# in edit mode to automate things yes

steady blade
#

Hello, I have a quick question, in a behaviour tree, should all the childs in a sequence run in the same frame or should the sequence return running after processing each child ?

golden notch
#

how about player data? (inventory), how would i make that persist through game sessions?

#

and serverside data

rich adder
#

use a VPS of your own or start using free tiers with premade solutions like Unity CloudSave

grand snow
#

or dump it into a file

golden notch
#

do I use "MakeSerealizable"? because "Serealizable" is erroring out

grand snow
#

just google it next time

golden notch
#

oh i didn't have "System" namespace added

grand snow
#

your ide will let you auto add that

#

you learn with time what namespaces certain things are in

primal sage
#

Anyone know how I can generate random points within the green area?

slender nymph
#

use the relevant method on the Random class to generate a point within the circle/sphere, if it is below the min distance generate again until it isn't

surreal sable
#

Hi guys. Any idea how people make use of the Unity Game Service in particular the player data save portion?

As it's a key value pair, I simply store all my data in the key core_data and stringify the object as a JSON.

I was able to get it to work however, I'm unsure if that's the convention. (I'm pretty sure if i save it as the value pair such as PlayerCoin:0) That would be more readable right

valid violet
#

I think better to write your custom save class to file.

#

because players will have direct access to json and can play with values

surreal sable
valid violet
#

I missed you are saving in cloud. It is fine in this case I though you store it on device as json

primal sage
naive pawn
#

this sounds O(1)?

#

boxfriend's method would also be O(1)

#

anyways, i don't think you even really need to normalize and get a new random variable

#

you can basically just map the magnitude, no?

primal sage
# naive pawn why O(n)

Because it doesn't have to repeat the roll if it's unsatisfactory, it always results in appropriate rolls. N represents the number of points you'd need.

naive pawn
#

even with rerolls, it'd be O(N), though.

primal sage
#

Meh.

#

Would prefer to know the result would be satisfactory first try every time.

eternal needle
naive pawn
#

that doesn't matter

eternal needle
#

0 * 1 = 0

primal sage
#

Define "too small"

naive pawn
#
Vector2 p = Random.insideUnitCircle;
p = p * (maxDistance - minDistance) + p * minDistance;
```....this doesn't sound right. `p * (maxDistance - minDistance + minDistance` is obviously not right
eternal needle
naive pawn
#

oh wait

primal sage
#

The odds that it lands a random roll on 0,0 is stupid low tho

naive pawn
#
Vector2 p = Random.insideUnitCircle;
p = p * (maxDistance - minDistance) + p.normalized * minDistance;
#

wouldn't something like this work (aside from the very small magnitude case)

#

wait no

#

that's not how magnitudes work...

eternal needle
primal sage
#

Cool, so I'll just delete the result and move onto the next roll if its mag is 0.

eternal needle
#

remaping the magnitude should just be fine as chris said

naive pawn
#

this does obviously still rely on the magnitude/normalized not being 0

primal sage
#

shit good point

golden notch
#

textmesh.GetPreferredValues(text); and textmesh.GetPreferredValues(text, 500, 30); both say that THIS is the prefferred size, how can I ensure it stays on one line and doesn't split when it's small?

undone wave
#

The particle system has some really useful features that makes it really easy to use

#

So I want to use some of them for my own classes. How would I do that through code?

#
  1. these custom modules you can enable and disable
#
  1. this thing (along with the corresponding variant for floats) apparently it's ParticleSystem.MinMaxCurve and ParticleSystem.MinMaxGradient
eternal needle
undone wave
#

i know how to interact with those

#

i'm looking for methods to implement them

untold shore
#

Hey! So currently I am having trouble with object destruction and instantiating an object. Currently, I have an object that is being instantiated - a bullet - that is already created with a script called "BulletControl." The bullet has a Start() that calls Destroy(gameObject, 6.0f). I wanted the main bullet to stay to continue using it for future instantiating, but it keeps getting destroyed. Is there any alternatives that I can use instead to destroy objects after a certain amount of time that won't affect the first bullet, or maybe creating something where I don't have to have that first bullet already created into the scene.
Code: https://paste.ofcode.org/5rsHyRVcwMAwrYXpnd77c2
Thank you! Please @ me if you respond.

eternal needle
undone wave
#

if i add for example, a rigidbody component to an object, the inspector displays a Mass field

#

which is a float field

#

which is easily recreatable in monobehaviour scripts using 'public float variableName'

eternal needle
undone wave
#

how would i do the same with those objects seen in ParticleSystem?

eternal needle
untold shore
eternal needle
#

unity has its own ObjectPool class

untold shore
#

I’ll definitely look into it! Thank you so much!!! UnityChanThumbsUp

median hatch
#

yo i updated my unity to the next patch, sicne there was that security update. Now my lights are disappearing when in the corner of the screen, im using Forward+ and 115 shadow max distance, what could it be?

teal viper
sour fulcrum
#

No dms

cosmic dagger
steep moss
#

is it possible to control several objects that have a specific tag using one central script? for example, if I have a cube that deals damage upon contact with the player, and I have multiple cubes, can I give them all a tag, then use a separate script to get all those objects with that tag, and use that script to handle things like collisions?

naive pawn
#

it's possible sure, but it's not necessarily a good solution

#

why do you need a centralized system to handle things like collisions?

#

if I have a cube that deals damage upon contact with the player, and I have multiple cubes
you can just give them all a script to deal damage upon contact with the player

#

the tag just seems like an extra step here

steep moss
#

collisions was just an example, generally speaking if i had a central script that used tags, technically i could use that to control multiple different types of objects (e.g: NPCs with differing behavior), rather than making a new script for each type of said gameobject, so making changes can be done in one script instead of having multiple different ones

#

is that a good way to organise code or is it not worth the effort and making separate scripts for each object is still better

naive pawn
#

it sounds like you're trying to recreate inheritance

cold leaf
naive pawn
#

you have the right idea in concept here, just sounds like you're missing the existing solution 😅

naive pawn
cold leaf
steep moss
naive pawn
#

just keep in mind that inheritance for components doesn't play super well with unity's own inheritance through prefabs/variants/instances, so consider composition for components instead (still using the same ideas/logic though)

#

(eg instead of a PlayerController that extends Entity, i have an Entity prefab that has the Entity component, and then an instance of that prefab has PlayerController)

median hatch
teal viper
median hatch
#

fixed

#

changed from forward+ to defered

#

lemme see the differences between both paths

real thunder
#

what is the best way to get a normal of a navmesh piece an agent currently standing?

shy tiger
#

My charachter just passby the wall, is there wrong on code?

using UnityEngine;
using UnityEngine.InputSystem;

[RequireComponent(typeof(Rigidbody))]
public class PlayerMovementRB : MonoBehaviour
{
public float moveSpeed = 5f;

private Rigidbody rb;
private Vector2 moveInput;

private bool touchingWall;

void Awake()
{
    rb = GetComponent<Rigidbody>();

    // Safety settings
    rb.useGravity = true;
    rb.isKinematic = false;
    rb.collisionDetectionMode = CollisionDetectionMode.ContinuousDynamic;
    rb.interpolation = RigidbodyInterpolation.Interpolate;
}

void FixedUpdate()
{
    // If pushing a wall, still allow gravity
    if (touchingWall)
    {
        rb.linearVelocity = new Vector3(
            0,
            rb.linearVelocity.y,
            0
        );
        return;
    }

    Vector3 move =
        transform.right * moveInput.x +
        transform.forward * moveInput.y;

    rb.linearVelocity = new Vector3(
        move.x * moveSpeed,
        rb.linearVelocity.y,
        move.z * moveSpeed
    );
}

public void OnMove(InputValue value)
{
    moveInput = value.Get<Vector2>();
}

void OnCollisionEnter(Collision collision)
{
    if (collision.gameObject.CompareTag("Wall"))
    {
        touchingWall = true;
    }
}

void OnCollisionExit(Collision collision)
{
    if (collision.gameObject.CompareTag("Wall"))
    {
        touchingWall = false;
    }
}

}

fickle plume
radiant voidBOT
crisp quest
keen dew
#

What have you set as radius, direction and distance? Is the radius small enough that the spherecast doesn't start inside the ground?

crisp quest
verbal dome
#

Check the actual values in the inspector

#

Those = 3f and = 4f only apply when you frist add the component

keen dew
#

If the actual radius is 3 it sounds like it probably starts inside the ground

crisp quest
#

how much it should be? i have asked AI and AI is so dumb in this

verbal dome
#

A bit smaller than the radius of your character's collider

#

Assuming it has a capsule collider (or sphere)

#

It also needs to start high enough to not overlap the ground at first

crisp quest
#

is there any way to learn from somewhere and a better way to do it? or its the best ?

verbal dome
#

Because if it does, it will not register the hit

#

You can use the physics debug window to see what's going on with the spherecast

verbal dome
crisp quest
ashen harness
#

Ik I've made that mistake a few times lol

crisp quest
zealous talon
#

hi, i want to use this material for a disappearing platform. my idea is modify the alpha's platform color, the problem is that when i put it in transparent mode the platform became "too trasparent", i want it to be opaque and modify the alpha value that let it be transparent. how can i do it? https://www.youtube.com/watch?v=M9w9v1CWtzE i'm following this tutorial that simply put hte rendering mode in transparent, but the option of the rendering mode does not appear in my inspector.

In this lesson, I will show you how to code and create a vanishing ghost platform. which are platforms that disappear a few seconds after a player object touches it. Ghost platforms are a very popular game mechanic that can be found in almost every platformer.

To create this game mechanic we will use a 3D cube, a transparent material, an anima...

▶ Play video
frail hawk
#

and the reason why the inspector values look different is because they are using standart shader and you are using urp shader

sturdy arch
#

Hey I need some help coding something can someone DM me personally? It's a FNAF fan game I'm making and need some help

cosmic quail
cosmic dagger
sturdy arch
#

Oh I'm sorry

#

Im making a FNAF fan game and need help like coding a camera like the player camera to pan back and forth when the mouse is moved left and right

naive pawn
#

right, do you have a specific question or issue with that?

#

if not, then we're just gonna point you to existing resources to save both our times (google)

sturdy arch
#

Well I've used YouTube and they seem to not like really work at all and I just want a panning camera it seems like it's hard to find

solar hill
#

is a panning camera just not a normal first person camera locked horizontally?

#

what am i missing here

frail hawk
sturdy arch
#

I have zero coding experience, confused on how I got this far of making my game

naive pawn
frail hawk
#

so learn programming and start developing and if you need help come here and ask

naive pawn
#

perhaps start with going through what the tutorials are giving and make sure you understand them

#

if you need help understanding something, you can ask here (though take a visit to google first)

#

if you can't get one to work and you need help, you can ask here, but you'll have to give some more info about how exactly it isn't working

solar hill
#

also a fnaf fan game seems kinda ambitious as a first project?

#

especially since you said you have "zero coding experience"

sturdy arch
#

Idk I wanted to challenge myself I was excited to make it

#

Do something with my time

solar hill
#

you need to scope it down a lot more

solar hill
#

practice more

#

and then when you have the basics down start working on a project

#

did bro leave

naive pawn
#

apparently

snow raven
#

Hello!

I've added a text mesh pro and once i did that my scene became all messed up.

I then deleted it but still can't see my player on the scene and keep getting these errors in red.

Any idea?

So frustrating, I just added a new element and then suddently it all breaks..

naive pawn
#

try restarting unity

#

i think this is just a unity bug

snow raven
#

nop, keeps happening restarted everything

solar hill
#

try reverting to a previous commit

#

its the nuclear option if you cant fix it normally

naive pawn
#

maybe try a library reset before that

solar hill
#

probably yeah clear out the folder and let it rebuild when restarting

snow raven
#

very new here haha. i think it could be indeed the mesh pro essentials which i had to install

frail hawk
snow raven
#

let me google how to do that clear out

#

unticked all my items and the error still shows

frail hawk
#

reset your cams

snow raven
#

i deleted my scene window and added new one

#

fixed it

#

don't know why or what happened but fixed it haha

frail hawk
#

you have deleted a cam in the hierarchy and that fixed it, you could also have resetted it

snow raven
#

don't know how to reset haha but this worked

frail hawk
#

you select a gameObject from the hierarchy then on the right side you hgave the inspector you can reset the components

queen adder
#
 ZipFile.CreateFromDirectory(linuxBuildDir, linuxBuildDir + ".zip", System.IO.Compression.CompressionLevel.NoCompression, false);

Why does this compress the zip file anyway?

naive pawn
#

not sure what you're asking

#

though, i guess technically it could

These values do not correspond to specific compression levels; the object that implements compression determines how to handle them.

queen adder
naive pawn
#

NoCompression doesn't actually mean no compression - that's your intent, and ZipFile might treat that as a little compression

queen adder
#

It's the exact same as optimal

#

Anyway is there something analogous to winrar's store?

naive pawn
verbal swift
#

why cant I access any of the cameras properties through code? im trying to change fov through input but I dont even get the option

#

ive tried typing it anyway but i just get errors

frail hawk
#

try lowercase cam

verbal swift
#

same problem

frail hawk
#

i dont think that both problem are equal, you can not say same problem

verbal swift
#

lowercase cam is the same as camera

#

and i get the same problem of not being able to access stuff like fieldOfView

naive pawn
keen dew
#

Show another screenshot where you have started with cam.

naive pawn
#

only real, existing cameras have those

keen dew
#

or the error message you get for cam.fieldOfView

verbal swift
keen dew
#

Have you made your own class called Camera

verbal swift
#

field of view is a property in the camera api

verbal swift
#

wdym by class

keen dew
#

ctrl-click on Camera and see what it opens

verbal swift
#

ohhhhhhhh mb

#

i may have called the camera script camera

#

durr

frail hawk
#

i think there should be some restriction by unity if you try to create a class that matches with one from the namespace

#

in my version there is a small warning message but it only appears once and then it is gone

willow iron
#

if i spawn an object with a large trigger collider, will the trigger collider automatically call ontriggerenter for those objects, or will the trigger not realize that there are objects inside of it because they technically never "entered" the trigger?

frail hawk
#

try it out and see

zealous talon
#

guys, i have a bug where all the animator controllers became empty when i compile the code, do u know why? i tried closing end reopen unity but it doesnt work. the error is this one
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Graphs.Edge.WakeUp () (at /Users/bokken/build/output/unity/unity/Editor/Graphs/UnityEditor.Graphs/Edge.cs:114)
UnityEditor.Graphs.Graph.DoWakeUpEdges (System.Collections.Generic.List1[T] inEdges, System.Collections.Generic.List1[T] ok, System.Collections.Generic.List`1[T] error, System.Boolean inEdgesUsedToBeValid) (at /Users/bokken/build/output/unity/unity/Editor/Graphs/UnityEditor.Graphs/Graph.cs:387)
UnityEditor.Graphs.Graph.WakeUpEdges (System.Boolean clearSlotEdges) (at /Users/bokken/build/output/unity/unity/Editor/Graphs/UnityEditor.Graphs/Graph.cs:286)
UnityEditor.Graphs.Graph.WakeUp (System.Boolean force) (at /Users/bokken/build/output/unity/unity/Editor/Graphs/UnityEditor.Graphs/Graph.cs:272)
UnityEditor.Graphs.Graph.WakeUp () (at /Users/bokken/build/output/unity/unity/Editor/Graphs/UnityEditor.Graphs/Graph.cs:250)
UnityEditor.Graphs.Graph.OnEnable () (at /Users/bokken/build/output/unity/unity/Editor/Graphs/UnityEditor.Graphs/Graph.cs:245)

radiant tulip
#

Hey yall, I have a multiplayer question/bug that im having on my project.. can I ask it here or is it in another channel?

frail hawk
prime goblet
#

Also

#

!code

radiant voidBOT
blissful fable
#

https://paste.mod.gg/wzwolrlhsqnb/0
https://youtu.be/gTQafQPNpUU

Hey everyone, I could use some help, I've been stuck on this for ages.

All I'm trying to do is have the jump animation play when the player jumps by pressing spacebar. but it just won't!
Even though the debug message says the jump condition is triggering, the jump animation doesn't play. It does play when I click the jump button on the inspector, but that's it. What's going on?

#

(first part of the vid is me pressing jump button, and even though the player moves up, the animation doesn't play)

paper rover
#

I can't for the life of me get the Depth and Normal passes from my camera and visually render them onto a Render Texture

#

helpplz imma cry

raven perch
stone glacier
#

so there is the player.
There is a big collider on the camera, to detect if you are looking on a tree
But there is the problem;
void ontriggerenter(Collider other)... etc
if you are close to water, and you look at it, you will slot down.
how to ignore a collider if its on the player but also the script?
like the if other... not going to work, because the player is not the other collider

blissful fable
raven perch
#

Sorry I cant help more, I usually handled my jumping with a bool and not a trigger. I create a isjumping bool, set it to true when jump is pressed, then set it to false when collided with the ground layer.

solar hill
#

pretty sure you just have to set up some physics layers for that

stone glacier
solar hill
#

also i dont think using a collider is a good approach to detect if the player is looking at something specific

stone glacier
#

its the tree script xd

blissful fable
iron cobalt
#

yo!
tryna see if an idea for a feature i have is the "optimal" or even "okay" way to do what i wanna do.
I got a gum player object, that's supposed to stretch towards the mouse when holding left click, when it hits a ceiling etc, act like a grappling hook.
I was looking at grappling hook tutorials, but they all kinda beam you near the position you hit, and the rope also doesnt have collision or can fold around corners.
My logic:

  • 2d raycast from the bone closest to the mouse.
  • get distance/angle between bone and wall/ceiling it hits behind the wall.
  • divide into n amount of segments.
  • create a new Rigidbody2d, circle/boxcollider2d on top of original bone
  • Move at angle and to position of raycast.
  • Once "far enough" away, enable collision, connect via springjoint
  • Repeat "create a new Rigidbody2d etc.." until all segments exist
  • all other stuff with being stuck to the point

Just tryna see if Im missing a way easier way before I start typing away.
Thanks yall :))

charred monolith
grand snow
#

Camera exposes everything, did you even try? @verbal swift

verbal swift
#

yes rob 5300 because youve never made an obvious mistake in your life cus ur perfect

#

sybau

verbal swift
#

i called a script Camera which is the exact same as the way youd call Camera.fov

charred monolith
grand snow
#

Well if we look at the documentation its easy to see that fov is a property we can modify. a quick google gets us to the page easily

charred monolith
verbal swift
grand snow
#

Ah well that makes sense (you "hid" UnityEngine.Camera)

verbal swift
#

i called a script camera

grand snow
#

All unity classes are in a namespace so it can be worked around but best to not name your things the same as unity classes

charred monolith
charred monolith
verbal swift
#

fixed now i can use all the camera stuff fine

charred monolith
verbal swift
#

i fixed it like 3 hours ago idk why it got replied to

grand snow
#

oh ha that is weird

raven perch
#

Looking for a nudge in the right direction.

  • I wrote pixel data to a texture and made a shader to add a grid where i can adjust the line thickness. (left image)
  • I'd like to also overlay the green divisions like the right image. Theses lines fall between pixels so I'm wondering how I could best draw this.
    I was thinking i could draw pixel data on another texture then blend them but it's a little confusing trying to make something like a vector line align with a rasterized line lol.
ancient nimbus
#

Orientation.localRotation = Quaternion.Euler(0f, MouseMotion.y, 0f);

    float VerticalInput = Input.GetAxisRaw("Vertical");
    float HorizontalInput = Input.GetAxisRaw("Horizontal");

    Vector3 MovementInput = new Vector3(HorizontalInput, 0f, VerticalInput).normalized * CurrentSpeed;


    if (MovementInput != Vector3.zero)
    {

        PlayerRB.linearVelocity = new Vector3(MovementInput.x, PlayerRB.linearVelocity.y, MovementInput.z);

    }

how can i make the movement toward the Orientation?

grand snow
grand snow
#

you can do Quaternion * Vector3 to do this

raven perch
grand snow
raven perch
#

I was lucky enough to be able to just generate the gridlines with a quick trick to math the tiling and offset with unity units. What could the process of getting the other lines into my shader look like? Am I limited to drawing pixel data on a raw texture or can you think of other ways I could create the data to pull it into the shader to play with?

#

That probably makes more sense to create a mesh with code and bring it in rahter than messing with rastered data.

grand snow
#

If the data can somehow be put in a texture that your shader can sample that could possibly work

#

Otherwise id just generate and write to a texture via cpu/compute shader once
Line renderers are a viable alternative

verbal swift
#

does universal 3d and 3d (built in render pipeline) handles physics differently?

#

because ive literally copied everything over 1 to 1 yet the universal project has a bug that the other doesnt

#

my only guess rn is that they handle physics ever so slightly different

zenith cypress
#

The render pipeline is just the render pipeline. It doesn't change stuff about physics, no. If the two projects aren't the same unity version, you can have differing physics qualities just due to that, but same version across URP and Built-In will be the same package.

verbal swift
#

yh theyre the same so god knows how urp has a weird physics bug

#

no post proccesing ig

verbal swift
#

its such a nothing issue but i copied it 1-1 down to player model position and everything

#

it just shouldnt happen yet it is

sinful gazelle
#

how to change this via code?

cosmic oyster
#

Yo guys someone can help me pls i dont know to solve this

solar hill
#

and the code itself

cosmic oyster
#

the code doesnt show any erros

#

errors

#

but i will send

solar hill
cosmic oyster
#

idk

zenith cypress
cosmic oyster
#

i just put some texture

#

and this happend

#

i was using a tuturial from youtube

#

this the code that have the error

sinful gazelle
#

hello is there a way for it to use singleplayertransport?

cosmic dagger
radiant voidBOT
candid pilot
#

İ am making a 3d game and i use raycasta(bunch of) to simulate their sight to detects player or otger stuff. But raycasts are heavy even tough i update them in fixedupdate. Are there any alternetives for that. İ have heard about dot products

#

Simulate the sight of enemıes

#

Sorry for typo

sour fulcrum
#

how many raycasts

#

cuz they are not heavy

solar hill
#

raycasts are pretty cheap all things considered

unique remnant
#

I'm doing a bit of some c# variables rn

serene niche
#

does anyone know why when I change the value of my variable in code, it doesnt update in the editor?

#

I originally had it as 4 and 5, then updated maxForce to 8 but it doesnt change on the editor

#

the code changes in the scripts section

#

but not the public variable values

sour fulcrum
#

Code defaults only apply when the instance of that class is first made, which is when you added that component

#

After that unity values take control, otherwise the code would just constantly override your inspector values

serene niche
#

would those changes be updated on the code?

#

if not wouldn't my local editor and the code itself be different? does that create any conflicts

sour fulcrum
#

Remember your Script is like a blueprint for something that will exist, it defines what it is, what it has and what it can do

An Instance of your Script is the actual "living" version of it, which in this case is the component on that gameobject

rich adder
#

unity never touches the original textfile

serene niche
#

I see

#

thanks guys!

broken sapphire
#

hi i need help with something

#

im following a tutorial and its already not working

naive pawn
#

just ask, no need to lead with that

#

!ask

radiant voidBOT
# naive pawn !ask

:thinking: Asking Questions

:mag: Search the internet for your question!
:book: Use the API Scripting Reference and User Manual and this troubleshooting site for commonly posted issues.
:wrench: Attempt to debug your issue.
:thought_balloon: Find an appropriate channel by reading the name and description in #🔎┃find-a-channel
:grey_question: And don't ask to ask, ask a full question illustrating with screenshots if needed.

-# For more posting guidelines, go to #🌱┃start-here

naive pawn
#

you'll have to provide some details

broken sapphire
#

so can you help?

teal viper
broken sapphire
#

huh

naive pawn
#

is there something there you need clarification for

#

just a "huh" does not tell us anything

#

we aren't psychic

waxen tapir
#

public class PlayerController : MonoBehaviour
{

    [SerializeField] private float moveSpeed = 5f;
    [SerializeField] private float jumpForce = 5f;
    [SerializeField] private Rigidbody2D rb;
    [SerializeField] private int extraJump = 1;

    public Vector2 movement;
    public Vector2 boxSize;
    public float castDistance;
    public LayerMask groundLayer;
    private float coyoteTime = 0.25f;
    private float coyoteTimeCounter;
    private float jumpBufferTime = 0.2f;
    private float jumpBufferCounter;
    
    
    // Update is called once per frame
    void Update()
    {
        
        // set movement fomr input manager
        movement.Set(InputManager.movement.x, InputManager.movement.y);
        if (InputManager.jump)
        {
            jumpBufferCounter = jumpBufferTime;

        }
        else
        {
            jumpBufferCounter -= Time.deltaTime;
        }
        JumpLogic();
    }

    void FixedUpdate()
    {
        rb.linearVelocity = new  Vector2(movement.x * moveSpeed, rb.linearVelocity.y);
    }
    private bool IsGrounded()
    {
        if (Physics2D.BoxCast(transform.position, boxSize, 0, -transform.up, castDistance, groundLayer))
        {
            Debug.Log("On ground");
            return true;
            
        }
        else
        {
            Debug.Log("not on ground");
            return false;
        }
    }

    private void OnDrawGizmos()
    {
        Gizmos.DrawWireCube(transform.position-transform.up * castDistance, boxSize);
    }

    private void JumpLogic()
    {
        if (IsGrounded())
        {
            coyoteTimeCounter = coyoteTime;
            extraJump = 1;
        } 
        else
        {
            coyoteTimeCounter -= Time.deltaTime;
        }

        if (jumpBufferCounter > 0 && coyoteTimeCounter > 0 && extraJump > 0)
        {
            extraJump--;
            Jump();
            jumpBufferCounter = 0;
        }
    }
    private void Jump()
    {
        rb.linearVelocity = new Vector2(rb.linearVelocity.x, jumpForce);
    }
    
    
    
}
``` Can someone help me understand how to implement coyote time and or jump buffer. i originally had a working double jump now after adding it seems that nothing worked LOL
naive pawn
#

what's the issue you have

waxen tapir
#

in taht code its like the coyote time doesnt actually do anything something is preventing my coyote time from even happening

ivory bobcat
#

Explain what's happening and what isn't.

naive pawn
#

coyoteTimeCounter > 0 && extraJump > 0
you need to both have the coyote time and the double jump available to be able to jump - that doesn't sound right, either you use coyote time or the extra jump
you also don't have anything allowing jumping while already on the ground, it seems

spring hill
#

hey guys Kind of beginner game dev , so does not able to fix issue where , I do show projectile before release a throw , and prview is working correctly but my throwing force or velocity is not correct and creating a slow motion kind of effect and it feel like a my fruits a fly bird as welll as going towards a direction very slow can someone here can guide me and help me to fix this issue so it can explain me as well as guide me

naive pawn
#

!code

radiant voidBOT
naive pawn
#

would also help to only share the relevant bits - probably where you're doing the physics

spring hill
#

@naive pawn can you able to join a vc I could share screen not famillar with all thing could guid me to look through and fix and explain me as well.

naive pawn
#

no

spring hill
naive pawn
#

what's the intended behavior and what's the current behavior that's the issue here

undone wave
#

What's the simplest method to change the name of a variable shown in the inspector?

#

for example, TMP_Text has this property

undone wave
#

i don't think i can have parantheses in variable names

naive pawn
#

oh, yeah no you can't change components you don't own

undone wave
#

i meant like:
how do i change the names of variables i declare in my classes

spring hill
#

im a beginner if I do able to understand that much why do I even ask a basic question

undone wave
#

in a way that has a different name in the editor and the inspector

spring hill
#

if someone is avialble to help me and guid me please let me know

undone wave
#

more specifically, having an editor name like "classNameTest", while showing "Class Name Test (units)" in the inspector

sour fulcrum
undone wave
#

ohh ok

naive pawn
spring hill
#

I think no one love to help and educate

naive pawn
sour fulcrum
naive pawn
#

you need to describe what the issue is

spring hill
#

I do describe a problem

naive pawn
#

what's the intended behavior and what's the current behavior that's the issue here

#

what's the intended behavior

#

also like i mentioned before, it'd help if you sent just the relevant code instead of the entire class

#

is ThrowFruit the method that you're having issues with

spring hill
#

behavior should a accurate throw of a object where , using a fruits as an object to thow inside a bucket , but a current behavior is showing slow motion behavior when i release a throw object from a hand

sour fulcrum
#

why is it slow

spring hill
#

and also have problem with a projection of projectile . let me send a video

#

of 10 sec

naive pawn
#
  • try debugging launchVel to make sure it's what you expect
  • what are power and powerMultiplier set to?
  • what's the gravity set to?
  • have you perhaps set the time scale somewhere?
spring hill
spring hill
#

@naive pawn check video as well once please is there are more thing i should look for

naive pawn
#

how large is everything? make sure stuff isn't scaled up a ton

spring hill
#

Can just able to join and guid me a little bit for a 10 min it would be enough , no need more just tell me what to do then you would leave I will fix it .

naive pawn
#

there aren't any vc's here for a reason

spring hill
#

can we join on personal

#

you can do unfriend me easy as well

sour fulcrum
#

no

#

there aren't any vc's here for a reason

spring hill
#

I just need guide Im begging

sour fulcrum
#

you can find help and support here

#

not handholding guides

spring hill
#

It's ok leave

#

it

#

you are thinking im asking for hand holding guie but im not asking for that

#

so its ok I will take help from somewhere else they would be good guide not like you an ego who does not want to educate

sour fulcrum
#

people are happy to help, just not in vc's

spring hill
#

sorry to bother you have good day .

teal viper
spring hill
#

@teal viper not asking for tutor , tutor can help me till I full learn all things not a some little small thing for 10 or 5 or 2 min

prime goblet
#

no that is what tutors do

#

ask your question already

teal viper
spring hill
#

bro I already got person we are working on fix just , keep your thoughts process to you guy do nt spread a false awenress

#

@prime goblet why do you want to know ?

prime goblet
#

you asked for help?

spring hill
#

help can done so many ways

prime goblet
#

instead of asking for someone to hop in vc you could just post your question

#

which is what the server is for (mainly)

spring hill
#

do it your way I got from another server

prime goblet
#

your problem dude

spring hill
#

it's your tiny brain keep to you

rough granite
# spring hill I think no one love to help and educate

Ah you caught us those of us in this server to help are all actually just here to mock and laugh at you guys for your dumb questions after all why should we waste the time from our day when all we get back are snide comments like this

fickle plume
#

!warn 325261025819492353 Don't insult people, and next time either post the problem or stop spamming the channel.

radiant voidBOT
wraith moon
ancient nimbus
wraith moon
#

bitrate kinda killed the debugray but its whatever

frail hawk
#

lock the max rotation on that axis

grand snow
#

Its normal to clamp rotation to avoid going to far. This is easier when we handle rotation as euler values

wraith moon
#

yeah i just realized this

#

wouldve thought that attaching it to the main cam wouldve had it follow the axis automatically and thus not go over 90 degrees but apparently not

grand snow
#

Anyway usually we read mouse input and change the camera rotation using this

wraith moon
#

yeah i have a seperate script that handles this for the main cam

grand snow
#

Over there you should clamp the local x rotation to be in the range -89 > 89 or so

wraith moon
#
{
    float mouseX = Input.GetAxisRaw("Mouse X") * mouseSensitivity * 100f * Time.deltaTime;
    float mouseY = Input.GetAxisRaw("Mouse Y") * mouseSensitivity * 100f * Time.deltaTime;

    yaw += mouseX;
    pitch -= mouseY;
    pitch = Mathf.Clamp(pitch, -maxLookAngle, maxLookAngle);

    // --- STRAFE TILT ---
    float strafeInput = Input.GetAxisRaw("Horizontal");
    float targetRoll = 0f;

    if (isSprinting && isGrounded)
    {
        targetRoll = -strafeInput * strafeTiltAngle;
    }

    currentRoll = Mathf.Lerp(
        currentRoll,
        targetRoll,
        Time.deltaTime * strafeTiltSpeed
    );

    transform.rotation = Quaternion.Euler(0f, yaw, 0f);
    cam.transform.localRotation = Quaternion.Euler(pitch, 0f, currentRoll);
}
#

my guncam is an overlay cam if that helps

#

okay, the problem i was facing was completely unrelated to the way i handle mouselook but i fixed it

verbal dome
wraith moon
#

ic

#

thanks for the advice

spring hill
#

@rough granite what you think I do like to pass those comment and look there are two kind fo problem for beginner one which are visual explained and one which are explain by words , so don't act like a tough guy here

fickle plume
#

!mute 325261025819492353 3d Ignoring warnings, spam. This is your last warning.

radiant voidBOT
gloomy heart
#

is this ragebait

wraith moon
#

this guy is 100% deadass dude

ancient nimbus
#

help why is this not working?

        HeadEulerAngles.x = Mathf.Clamp(HeadEulerAngles.x, MinHeadRotation, MaxHeadRotation);```
#

its been 1 hour i'm tweaking

rough grove
grand snow
#

Yea you need to write back the rotation changes to the transform

rough grove
ancient nimbus
#

oh it was this simple..

#

thank you so much for ending this suffering

grand snow
#

Unity doesnt even store rotation as euler angles, its just an alternate format thats easier for us humans to use

naive pawn
cunning narwhal
#

I'm having a hard time understanding why my ScriptableObject was failing to save to disk (it saves to the instance in memory just fine) because my path to the SO had a space in it. Whats the deal here?

sour fulcrum
#

you'd need to provide context

#

what do you mean save to disk? is there code involved here?

grand snow
#

If its already an asset you can just modify that and save it with AssetDatabase or make it dirty

cunning narwhal
#

There is, it's for an editor window and I'm using SetDirty, the class is serializable, I'm using AssetDatabase.SaveAssets(); AssetDatabase.Refresh();
everything is being added to the instance of the SO when I view it in the inspector but it's not actually modifying the .asset file on disk

sour fulcrum
cunning narwhal
#

Thanks

sonic vector
#

So where do I start

frail hawk
#

download and IDE and start with c# basics

sonic vector
frail hawk
#

have you ever used any programming language before

lunar axle
#

so im using the Old Input Manager of unity and im wondering how can i get the current KeyCode that is being pressed in the frame? (without knowing like which KeyCode to check)

naive pawn
#

there is inputString, you could probably make a mapping (though it wouldn't be actual keycodes)
i think the other option is to just loop all of them

naive pawn
kind charm
#

Hello!

#

I started with Unity today!

lunar axle
naive pawn
#

no, that's not really a thing

#

KeyCode is an enum

#

you would have to have a mapping from each char to the respective KeyCode

lunar axle
#

what i meant is like it returns "a" instead of KeyCode.A

naive pawn
#

yeah, i think so?

lunar axle
naive pawn
#

though it'd probably not include modifiers

#

and shift might make it "A", you'd have to test

lunar axle
naive pawn
#

if you actually need a solid check for KeyCodes, i think looping over them would be the more solid bet, but that depends on your usecase i guess

naive pawn
#

a lot of possible edge cases

lunar axle
#

well i think it would result in slower times, frame rate drops?

naive pawn
#

what about when holding alt or altgr or shift, or for different languages?

naive pawn
#

there are 339 members of KeyCode, that can be done in an instant

lunar axle
naive pawn
lunar axle
#

thanks for ur help

true pasture
#

Hey, swapped to VScode since I last used unity. I cannot get intellisense to work. For example [SerializeField] will not autocomplete, I cannot ctr click on things to go to other scripts.

Does anyone know what im missing.

grand snow
#

!ide

radiant voidBOT
grand snow
true pasture
#

I have tried that.

#

Also regenerated project files

grand snow
#

Got the extension installed in vs code too?

#

VS code isnt as good as VS but Ctrl + space should still provide similar suggestions

true pasture
#

I just dont get what im used to for the autocomplete . [SerializeField] doesnt show at all

#

Do you just recommend i swap back to visual studios

naive pawn
#

ctrl+shift+p > install .net

true pasture
#

like this?

naive pawn
#

yeah

grand snow
true pasture
#

Okay installing .net did fix it. Wonder why that wasn't in the guide maybe I uninstalled it at some point? Thanks Chris. But yeah to robs point, I just like vscode because its faster and cleaner UI to me. But yeah I can swap to visual studioes if I have endless problems.

slender nymph
#

it technically is part of the guide, but only in so much as it should be automatically installed with the c# dev kit.
the output tab in vs code should have told you there were problems and that .net needed to be installed

true pasture
#

Makes sense yeah. I probably did ignore that message in vscode. mb

grand snow
#

vs code is probably slower seeing as its JS + electron

#

anyway if it works thats good

true pasture
#

It feels faster from my experience. Might not be true but.

naive pawn
#

i feels more streamlined to me (not that i can use vs anyways lmao)

grand snow
#

Well imo debugging is just a worse experience in vs code and thats very important to me

cosmic oyster
#

Guys im running into a problem with the text mesh pro basicly im trying to show the ammo 30/30 and the textmesh doenst show up but in hte text input show up the current ammo i have

#

in the editor

#

in game

naive pawn
#

if you put in text in edit mode, does it show up

cosmic oyster
#

yes

naive pawn
#

in play mode when you see the text has content, does it show up in the scene?

#

wait this is the code channel

cosmic oyster
#

edotpr

naive pawn
cosmic oyster
#

okok

cosmic oyster
#

i put code also in this

#

to set the current ammo

#

the code works the ui doesnt work correctly

naive pawn
#

everything with a computer involves code, here it seems the UI isn't working so it'd be for #📲┃ui-ux

cosmic oyster
#

okok

naive pawn
#

even UI-specific code would go there if the issue was with configuring the UI

#

if it were like syntax stuff or logic flow, then it'd fit here

grand snow
#

use whats in the UI menu only

cosmic oyster
#

can u show me in a call?

naive pawn
#

ah, that's probably the issue

#

woooo issues with crossposting

grand snow
cosmic oyster
#

😭 idk honestly

fathom crest
#

If I have absolutely no idea about coding, can I solely rely on Junior Programmer Pathway on Unity Learn? Or should I specifically learn about C# first, then start the course later?

naive pawn
frail hawk
#

i would recommend learning c# first without unity programming

naive pawn
#

the junior programmer pathway is, imo, a good starting point to show basic features you need for unity, but it doesn't really explain anything, you'd have to go research those yourself

#

learning c# on its own separately also helps reduce the mental workload of learning many things at once, and it can be useful to understand what parts are from c# and then see what extra stuff unity has

fathom crest
#

Can you recommend how much I need to learn about C# to create a game? Like, when do I need to feel like "ok, this is enough"

naive pawn
#

not really, it depends on a ton of things

solar hill
#

so theres no threshold

lunar axle
#

does JsonUltility supports parsing MonoBehaviours?

lunar axle
versed fjord
#

All you need to know is key words, algorithms, software architecture, webservices, threading and Unity related stuff

naive pawn
versed fjord
naive pawn
#

nor would that be particularly conducive to unity dev

#

you won't use threading to start out, and you'll just end up forgetting, for example

versed fjord
#

Yess learn the fundamentals

naive pawn
#

new stuff is being made all the time, and you can't even use all of it in unity because mono is behind on .NET version lmao

versed fjord
#

I usually try to do something, see what I dont understand, learn it and then implement what I learned

naive pawn
#

if you set a goal on learning 100% you'd never do anything else

versed fjord
#

And the truth is if you only do what you already know, its dead boring

edgy tangle
median hatch
#
#region Attacking

    protected override IEnumerator AttackTimer()
    {
        animator.applyRootMotion = true;
        agent.isStopped = true;

        animator.SetBool("isSecondAttacking", true);

        yield return new WaitForSeconds(0.8f);

        animator.SetBool("isSecondAttacking", false);

        animator.applyRootMotion = false;

        agent.nextPosition = transform.position;
        agent.isStopped = false;

        yield return new WaitForSeconds(0.1f);

        SwitchState(EnemyStates.Moving);

        yield return null;
    }

does anyone know why the enemy is teleporting to me after the animation ends?

#

im trying to switch between no rootmotion and rootmotion for attacks

#

to make them more natural

hearty salmon
# median hatch ```cs #region Attacking protected override IEnumerator AttackTimer() { ...

I believe it's due to a desynchronization between NavMeshAgent and Root Motion.


protected override IEnumerator AttackTimer()
{
    agent.isStopped = true;

    
    agent.updatePosition = false;
    agent.updateRotation = false;

    animator.applyRootMotion = true;
    animator.SetBool("isSecondAttacking", true);

    float t = 0f;
    while (t < 0.8f)
    {
      
        agent.nextPosition = transform.position;
        t += Time.deltaTime;
        yield return null;
    }

    animator.SetBool("isSecondAttacking", false);
    animator.applyRootMotion = false;

    
    agent.Warp(transform.position);

    agent.updatePosition = true;
    agent.updateRotation = true;

    agent.isStopped = false;

    SwitchState(EnemyStates.Moving);
}
#

If it doesn't work, let me know so we can try something different.

grizzled crag
#

hey so I'm currently making a 2d game and I'm having a bit of trouble deciding whether or not it's a good idea to make it so each bullet is performing a raycast, checking if it hit something or should I just put a rigidbody onto the bullet

#

which is more performant?

naive pawn
#

figure out what solution would give the behavior you want

solar hill
shell sorrel
grizzled crag
#

I mean, should I put the raycast on the bullets themselves

shell sorrel
#

raycast is instant

grizzled crag
#

because currently it's setup without an rb so I have to use raycasts to check for collision

shell sorrel
#

can just check for collsion events on it

grizzled crag
#

oh I don't have to use an rb to check for collision?

naive pawn
#

if you want something like hitscan, you wouldn't have a physical bullet at all, just vfx

grizzled crag
#

yeah I want the physical bullets to hit, I just don't know if rb on the bullets or a raycast fired by the bullets themselves is the way to go

naive pawn
#

do you want a projectile or hitscan
if hitscan, use a raycast
if projectile, use a physical bullet with a rigidbody and a collider

#

a raycast on a bullet doesn't really make sense

#

what is it supposed to detect? that it hit something? but that would be when the bullet hasn't hit the thing yet

grizzled crag
#

I mean, if the ray picks up an interface of say a damageable thing

shell sorrel
#

its its a physical bullet with travel time just make it a rigidbody

naive pawn
#

the ray has no part in that

#

the ray just gets a collider

#

a collision can also get a collider

grizzled crag
#

so ray and rb have no issues in performance?

naive pawn
#

then you can get that component from the collider

shell sorrel
#

ignore performance for now

naive pawn
shell sorrel
#

you are best to take the simpliest way forward that fits your intent

#

if there is a performance issue profile and figuyre out why

naive pawn
solar hill
grizzled crag
#

alright I'll keep that in mind--design first then performance

solar hill
#

which is a lesson i learned when i decided to stick with projectiles over raycasts for my project

naive pawn
shell sorrel
#

chances are if you get a perf issue it wont be the collisions it will be the instantiations

#

which would not be solved by raycasting it

grizzled crag
#

in which case I'd probably need to look into object pooling or something right

shell sorrel
#

yes

solar hill
# naive pawn don't rigidbodies cast the collider to prevent this?

honestly i lost my mind trying to fix it and implementing this:


private void FixedUpdate()
{

//ant-tunneling i stole from unity discussions
    if (hasHit) return;
    
    Vector3 direction = transform.position - previousPosition;
    float distance = direction.magnitude;
    
    if (distance > 0.01f)
    {
        if (Physics.Raycast(previousPosition, direction.normalized, out RaycastHit hit, distance))
        {
            if (hit.collider.gameObject != sourceObject && hit.collider.gameObject != gameObject)
            {
                hasHit = true; 
                transform.position = hit.point;
                HandleHit(hit.collider, hit.point, hit.normal);
                return;
            }
        }
    }
    
    previousPosition = transform.position;
}```


Fixed it for me.
shell sorrel
#

i would take the path that gets things working correctly to design fastest so you can play with things and figure out if there are more issues to solve

naive pawn
grizzled crag
#

alright! Thanks guys

naive pawn
solar hill
#

yeah i have them on continous for the projectiles rb, but at higher speeds the tunneling is unavoidable

#

that raycast check is the only thing really making it work

#

and let me just say something, doing it is completely pointless, apart from like slower firing flechettes? when the hell would i ever need these projectiles

#

i should have just went with raycasts but now i have to commit

jagged vortex
#

Hello, I am having a hard time with optimally designing my games and it is causing me a lot of frustration and causing me to just stop working on many projects and just ramming my head against the wall on the same things. Does anyone have advice for this? Do you usually feel like your game is perfect or as you develop are there many things that you start to realize you should have done earlier and then end up wanting to restart the whole thing. I can give examples if needed

slender nymph
#

focus on making something work before making it "optimal"

solar hill
#

especially if youre experimenting and you realize that the foundation for your project isnt as solid as you hoped, it might be faster and more efficient to start again, but this something that happens early on in the development

#

rarely at later points

brazen wren
#

Hello guys, I'm new to Unity and I'm currently working on a 2d boss rush project game and I wanted to know if yall have some advice to use well ai for boss ?

brazen wren
teal viper
brazen wren
#

How he play and use this animation when the player is at this distance

teal viper
# brazen wren Yeah like how he recognize where the player is

Well, you could hardcode it. Or you could use an FSM(state machine), behavior trees, goal oriented planning, and many other techniques algorithms to control the boss character.
Recognizing the pkayer would be done via sensors. Animations would be initiated from your code depending on your implementation.

scenic perch
#

Hey should I learn C# coding by itself before like trying to do coding in Unity? Would it really help a lot?

#

Cause a lot of it is just. Not sticking

#

Idk if thats just how it is or maybe its too much at once

teal viper
scenic perch
#

Yeah cause I see a lot of stuff in it that does look helpful, but at the same time a lot of it seems quite different than how unity actually handles it yk

ivory bobcat
#

What in particular are you having trouble with? Is this with regards to syntax, programming methodology or integration with the Unity API?

scenic perch
teal viper
scenic perch
#

Like I couldnt really explain what some things actually do

ivory bobcat
#

Normally you wouldn't unless you've seen it (the pattern) before or the lines of code have been properly documented (which most tutorials do not do properly)

scenic perch
#

Yeah ive seen a few here and there which kinda helped me grasp what a Quaternion is but a lot of it feels like. Okay put this here and there but doesnt really help explain how or why you would put this vs this or whatever

ivory bobcat
#

Quaternion isn't restricted to programming and is more of a math issue. Not many will understand it but can use it (the Unity type).

scenic perch
#

Yeah for sure, math is not my strong point at all

solar hill
scenic perch
#

Yeah it does feel like a more fun way to learn math tbh even if I dont understand a lot of it currently

#

Feel like ill get the hang of it once I actually learn how to put things together like puzzle pieces

subtle dirge
#

Cant remove package from project, even though i had already manually removed it from the project (and deleted the library folder and everything). It doesn't even appear in the manifest .json or in package lock?? Why is it still being shown. Also re-imported all to see if that would be the fix

teal viper
# scenic perch Yeah ive seen a few here and there which kinda helped me grasp what a Quaternion...

This all comes with experience: following courses, learning pathways, tutorials, reading the manual, the api docs, other people's code.
Its also important to make sure you understand what you're seeing well enough. If you see a word/syntax/technique you don't understand in a tutorial, the worst thing you can do to yourself is ignoring it. Instead, research it up, you should unserstand what it is even if in general terms.

scenic perch
#

Like sometimes idk if I should move on and come back or what but

solar hill
#

getting stuck on one thing

teal viper
#

Also, it's better to think of programming as building with bricks, rather than puzzles. There are numerous bricks that can all be used to achieve the same goal. In puzzle there's only one way.

scenic perch
#

Like not sure if I wanna tackle events while not being entirely sure of how to use vectors lmao

solar hill
#

theres a very loose linear order in which certain concepts are learned

#

i guess if you follow the learning pathways and most courses you will also follow this loose order

scenic perch
#

Yeah feels like that for sure, I do wanna learn state machines early cause it seems like an extremely useful thing to get stuck in my head

solar hill
#

but there gets a point where it sort of becomes a "sandbox" and that happens after you are done with the fundamentals

solar hill
scenic perch
#

Yeah like thats one thing where im like idk should I learn this now or later right

teal viper
earnest wind
#

guys this might be my dumbest question, but if i do

#if !UNITY_EDITOR

it would never get put in the editor right? there is no way for it to corrupt one day and actually run those lines right?

teal viper
teal viper
earnest wind
#

as a life saver if i delete that line for some reason

scenic perch
shell sorrel
teal viper
earnest wind
shell sorrel
#

the line as long as its there is 100% reliable

earnest wind
#

thank you

#

found it

#
Application.isEditor
ivory bobcat
# scenic perch Like not sure if I wanna tackle events while not being entirely sure of how to u...

If you're referring to Vector3 it's simply a type that holds three floats. It also provides other miscellaneous functionalities that you'll not need unless you're aware of it.

Math stuff like normalization, magnitude, projection, reflection, creating an angle from three points etc
Programming stuff like lerping, slerping, moving and rotating the value, interpolating etc (mainly common patterns that were implement for when operating with a set of three values)

scenic perch
#

Hmmm okay yeah UnityChanThumbsUp

#

Thank ya :o

brazen wren
stone glacier
#

it is a problem that i didnt use unity's ai for npc?
in water, its slows down,
and if its wall in front of the enemy, its rotates slowly and goes right until there is no wall, and start following the player again, its smooth i think

#
void OnTriggerEnter(Collider other)
{
    if (other.gameObject.name == "Radius")
    {
        InRadius = true;
    }
    if (other.gameObject.name == "eyes")
    {
        eyesInside++;
        Bar_Active = true;
    }
    if (other.gameObject.name == "water")
    {
        InWater = true;
    }
    if (other.gameObject.tag == "talaj")
    {
        talajInside++;
        wall = true;
    }

}

void OnTriggerExit(Collider other)
{
    if (other.gameObject.tag == "talaj")
    {
        talajInside--;
        if (talajInside <= 0)
            wall = false;
    }
    if (other.gameObject.name == "Radius")
    {
        InRadius = false;
    }
    if (other.gameObject.name == "water")
    {
        InWater = false;
    }
    if (other.gameObject.name == "eyes")
    {
        eyesInside--;
        if (eyesInside <= 0)
            Bar_Active = false;
    }
}

...
if (Enemy_HP > 0)
{
    transform.Translate(0, 0, -speed);
    if (!wall)
    {
        transform.LookAt(Player);
        transform.Rotate(0, 180f, 0);
    }
    else
    {
        transform.Rotate(0, 1f, 0);
        transform.Translate(0, 0, -speed / 2);
    }
}
#

on every barrier there is the "talaj" tag, and there is big collider on the enemy's head

#

is it okay, or too laggy?

ivory bobcat
#

I don't see how those lines of code would cause lag. Best use the profiler if you're concerned.

shell sorrel
#

i would not be wanting to do so much based on the names of things

#

bit on the fragile side, also CompareTag is faster then using ==

boreal apex
#

I have an incredibly stupid question I'm asking on this channel, because I have a bug seems to have come out of nowhere, and I want to recheck the basics.
My raycast based shooting mechanic suddenly doesn't register a hit on my enemy.
My hit checks for the tag "Enemy", but it literally doesn't hit the enemy collider. It hits the level geometry behind it and registers the level hit.
The enemy is kinematic, navmesh, and has a capsule collider on the root. It is not set as a trigger right now, but provides contacts.
The bones on the enemy rig have empty children with the box colliders attached.
I'm wondering what stopped working here when I was messing with other settings.
The box collider is tagged and layered as enemy.
I feel like something is misconfigured or maybe failing silently?
I have several systems built and now the one that worked forever isn't working anymore. I had to put the mouse down for a bit, but it has been annoying me all day.
Anyone have a text checklist for a basic raycast shooting system with rig bone colliders? (the bone doesn't have the collider to reiterate)

rich adder
#

and show the code and how you debugged the rayc

past bloom
#

guys I am brand new to scripting I don't know if I have this wrong but I have been trying to fingure out how to make the mario jump sound play when ever I press space. I have been doing this for an hour and can't seem to figure it out dose anyone know what to do?

slender nymph
#

hint: look at the docs for the AudioSource component

past bloom
#

ok wdym docs like google docs?

wintry quarry
#

!docs

radiant voidBOT
past bloom
#

ty

lunar axle
#

hey, how can i access the PriorityQueue data structure on Unity, cuz it seems non-existent inside the using System.Collections.Generic;. or i should copy paste an implementation of it on google?

slender nymph
#

PriorityQueue was introduced in .net 6 so not available in unity, unity only supports .net standard 2.1 or .net framework 4.8.1 (assuming you're on 2021+)

#

you could implement it manually if you really need it that badly

lunar axle
slender nymph
#

is there a reason you need a PriorityQueue specifically?

white rune
#

Heyyyyy so like, I'm trying to set up this thing where the player object faces towards the ground, but I wanna have it so it gradually rotates to be perpendicular to the normal, instead of violently snapping to face that orientation (which is what it currently does), any idea how the hell to go about that?

slender nymph
#

use Quaternion.RotateTowards to rotate it over time

white rune
#

The Raycast output isn't accepted by that tho

slender nymph
#

Did you by any chance read the documentation for the method to see what you should be passing to it?

lunar axle
#

its the properties of heaps, plus its way faster to push/pop instead of just sorting it all over again.

#

for my case specifically, im trying to instantiate the monster with the lowest health first.

cedar lagoon
#
if (Condition 1)
{
    
}
else if (Condition 2) // Execute if condition 1 is false
{
    
    
}``` 

i dont get it... isnt this the same as "else"?
#

so no difference right?

#

Like if i put if and then else

wintry quarry
#

if condition 2 is false the second brackets won't run

cedar lagoon
sour fulcrum
#
if (Condition 1)
{
    
}
else if (Condition 2) // Execute if condition 1 is false
{
    
    
}

is the same as

if (Condition 1 == true)
{
    
}
if (Condition1 == false && Condition 2 == true) // Execute if condition 1 is false
{
    
    
}
cedar lagoon
wintry quarry
#

only if those conditions are not guaranteed not to change in the first block

#

the second example could potentially run both blocks

#

depending on what's inside the first

median hatch
#
protected override IEnumerator AttackTimer()
    {
        animator.applyRootMotion = true;
        agent.isStopped = true;
        agent.updatePosition = false;
        agent.updateRotation = false;

        animator.SetBool("isSecondAttacking", true);

        yield return new WaitForSeconds(0.8f);

        animator.SetBool("isSecondAttacking", false);

        animator.applyRootMotion = false;

        agent.nextPosition = transform.position;
        agent.Warp(transform.position);

        yield return null;

        agent.isStopped = false;
        agent.updatePosition = true;
        agent.updateRotation = true;

        yield return new WaitForSeconds(0.1f);

        SwitchState(EnemyStates.Moving);

        yield return null;
    }

im trying to add more checks but not sure xd

cerulean flax
#

hi so a quick question do i need to learn entirety of c# or just some parts of it

sour fulcrum
#

depends on what you make

#

very little people know the entirety of c#

cerulean flax
past coyote
#

Hello everyone, I am a beginner who has only been learning Unity game development for a short time. I would like to create an effect where the player enters an indoor scene when approaching a door. However, I am not sure how to implement this.

My goal is that when the player approaches a door in the outdoor scene, it triggers a scene transition, and the player then appears at a fixed position inside the indoor scene, facing forward (from a third-person perspective, this means the player’s back is facing the camera). I want this to work reliably every time, with the player spawning correctly without bugs or position issues.

Could you please advise on how this can be implemented?

untold shore
#

Hey y'all - currently I am having a problem with Object Pooling, as I am doing it for my first time. Right now, after the bullet (which is pooled) has been created and deactivated, the bullet that is then reactivated and moved won't return to the "attack point" - instead it will go from the former position and then race towards that new position. After that object is created and presumably when reactived, it is meant to go to the attack point transform:

        currentBullet.transform.position = attackPoint.transform.position;

It's hard to explain without a video, which I'm trying to figure out how to send. Anyway - here is the entire code of the script if it'll help: https://paste.ofcode.org/WZCk5QLrUsNWQrk5C6dVKF
If you respond, please @ me. Thank you so much!

past coyote
untold shore
past coyote
#

I have already record a video ,but I can't send here🥺

median hatch
#

that repositionPlayer is the coords the player will teleport to

#

i also store an guid in the ChangeScene

#

when you click on one ChangeScene, it will save that Id into a JSON or singleton whatever you want

#

when moving to the next scene, the player will search in a list of ChangeScenes for the correct Id

#

finds it, then moves to the repositionPlayer transform position

#

and the forward position for you in this case as well

#

what makes this system good for me is that i can enter the same scene through multiple entrances

frail hawk
tiny island
#

oh my bad

fleet fern
#

Can can i ask a question on c even if its not on unity?

#

I have been stuck for a long time and need help

verbal dome
#

I assume you mean C#?

fleet fern
#

No normal C

frail hawk
#

i dont think that would be allowed here

fleet fern
#

Is there any other channel for non unity?

frail hawk
#

only unity related stuff here

versed fjord
#

If its if else while, then its fine

hallow badger
#

Hey! Looking for some good Unity 6 tutorials on FPS movement and level design. Anyone got recommendations?

solar pecan
#

Hey! So I'm working on a project where I'm trying to map mpu sensor coordinates on to a model in unity (trying to make a MoCap Katana basically). But I'm kinda stuck on the axis mapping. If anyone has any experience working with this sort of stuff do lemme know. Feel free to ask anything btw. Thx

stark flint
#

Hi, in my code when I jump next to a collider other than the floor I go flying in the air, would appreciate some help.

frail hawk
#

!code

radiant voidBOT
stark flint
frail hawk
#

first change this

    private void OnTriggerStay(Collider other)
    {
        grounded = true;
    }
    

to OnTriggerEnter and check for a tag

#

rn you are always grounded whenever you hit a Trigger

stark flint
#

but if i check for a tag will i still be able to jump off other colliders besides the floor

frail hawk
#

so i dont know what you want to achieve but assuming you want to set grounded to true when you enter the gorund you´d check for the ground tag

naive pawn
naive pawn
stark flint
#

player

#

I got a cylinder collider on the players feet

naive pawn
#

is that trigger set to only collide with the ground layer?

stark flint
#

yea

naive pawn
#

huh, you're setting grounded = false in fixedupdate?

#

that's... new

stark flint
#

is that wrong?

naive pawn
#

it's not a common way to do it afaik, i haven't seen this before.

stark flint
#

oh k

naive pawn
#

your grounded logic is separated between OnTriggerStay and FixedUpdate, kinda fighting over the state of grounded, it'll be flipping every fixedupdate

#

this seems like a fragile system to me

stark flint
#

oh, what should i do then

naive pawn
#

a common approach ive seen is to use Enter and Exit pairs to set the grounded state accordingly

stark flint
#

ok

hazy crypt
#

!help

radiant voidBOT
# hazy crypt !help
<:emote:1416393040439939103> Available commands

Use !help <command> to get more information

!collab
!code
!logs
!bug
!screenshots
!cs
!vc
!dots
!vrchat
!vscode
!blender
!vs
!forums
!learn
!install

hazy crypt
#

!code

radiant voidBOT
naive pawn
hazy crypt
#

Thanks, I was looking for it but the channel was hidden for me

#

Just double checking while its quiet here 🙂

#

So im having an issue with my brain, I have the following block of code to scroll around my 2D game:

#
 private void Update()
 {
     if (!mouseGrab) return;

     // move the camera
     difference = getMousePos - transform.position;
     transform.position = origin - difference;

     // scroll the background
     img_BG.uvRect = new Rect(img_BG.uvRect.position + new Vector2(difference.x, difference.y) * Time.deltaTime, img_BG.uvRect.size);

 }
#

the camera move works fine, but my background wants to scroll constantly, even when i am not pressing down my "mousegrab" button

naive pawn
#

have you tried debugging that mouseGrab variable?

#

see if its value is as you expect

hazy crypt
#

Yeah, it is trigged using unity events and seems to only output true when using the appropriate input action

naive pawn
#

(though for something directly in a message like this i generally wouldn't use a guard clause, it cuts off options of doing other stuff unrelated to that condition within Update)

hazy crypt
#

I see

#

I tried to put the background scrolling in a seperate if statement but that didnt work either

naive pawn
#

so, that statement isn't being reached when it shouldn't be, correct?

#

it could be something else also trying to scroll it, perhaps check for that

hazy crypt
#

No sorry, maybe im not explaining very well

#

The staments that move the camera are working correctly, only working when the player holds down the right mouse buton. The statement underneath that is intended to scroll the background while the player moves, that appears to be ignoring the right mouse button and is on constantly

#

despite me checking for the right mouse button before it

naive pawn
#

so have you debugged to see if that statement in particular is responsible?

hazy crypt
#

I have run it again while commenting it out and the scrolling stops, so i know that its responsible

#

So im not sure how it can be ignoring the check above it, unless im missing the way that this code works

naive pawn
#

ok so to be blunt, some of the info here contradicts, so something you've said must be incorrect

#

(mistakes happen, this isnt' anything against you personally)

hazy crypt
#

Okay sure, I can try to clear things up

#

Yeah sorry text is not an easy format to convey this in

#

Maybe I can take a short video with OBS

naive pawn
hazy crypt
#

sure, I have this block of code in the same script

#
public void OnDrag(InputAction.CallbackContext ctx)
{
    if (ctx.started) origin = getMousePos; 
    mouseGrab = ctx.started || ctx.performed;
}
#

and then in engine im using a playerinput component to trigger it

naive pawn
#

how's Look set up? i'm not particularly familiar with mouse input stuff so i'm gonna have to scour docs a bit

hazy crypt
#

Its the default unity input actions

grand snow
#

Why are you treating mouse movement as "mouse grab"?

hazy crypt
grand snow
#

anyway id expect this action to work correctly: any movement would either start or keep the action going

hazy crypt
#

The player sort of "grabs" the screen to move around

#

click and hold right mouse button, then drag and the camera moves

grand snow
#

Just keep that in mind so you dont confuse yourself

hazy crypt
#

Yes sorry, im using the right mouse click check seperately, that would be the "grab" part

naive pawn
#

yeah this is just gonna be started/performed whenever your mouse is moved , isn't it?

naive pawn
#

are you also setting it somewhere else?

hazy crypt
#

oooo

#

good point

#

lemme see

#

I think youve cracked it

#

Im not checking for the right mouse click anywhere

#

Im not sure how the code was properly functioning before tbh

#

Im gonna go and debug this and hopefully it solves things

naive pawn
#

ah yes, the duality of programming
"this doesn't work, i don't know why"
"this works, i don't know why"

hazy crypt
#

thanks a million both of you

grand snow
#

Good variable names matter!

celest zinc
#

Hi, not sure if this is the right channel.
I want to load a lot of prefabs in my c# script. So far I have used AssetDatabase.FindAssets(), but I can't use that in a build.
One option I also saw was using a Resource Directory, but I read it's bad practice.
What "best practice" options are there for me? Thanks

What I use right now:

        var guids = AssetDatabase.FindAssets("t:prefab", new[] { "Assets/CardData/PlayingCards" });
        foreach (var guid in guids)
        {
            var path = AssetDatabase.GUIDToAssetPath(guid);
            var go = AssetDatabase.LoadAssetAtPath<GameObject>(path);
            _cardDeckPrefabs.Add(go);
        }
naive pawn
#

do you need to load them at runtime? what's stopping you from just using serialized references?

celest zinc
naive pawn
#

you can select multiple assets to drag into an array/list

celest zinc
#

Feels too hard coded, if I want to switch something

celest zinc
naive pawn
#

both work

#

though, it might be a bit unintuitive - you have to drag to the field name

celest zinc
#

Whenever I click outside the inspector, it disappears

naive pawn
#

you need to lock the inspector

celest zinc
#

I didn't know you could lock...... thanks a lot.
(rip all the time I wasted implementing AssetDatabase.FindAssets() and looking up other options)

slender nymph
#

you can also select the "Properties" option from the context menu to pop out a little window with that component in it to assign things

rancid tinsel
#

is there a name for the 2nd constructor's syntax?

naive pawn
#

i don't think c# ascribes a specific name to it. i tend to describe that as delegating to another constructor
i'll have to dig through syntax specs to see, not sure how long that'll take

rancid tinsel
naive pawn
#

seems like both it and the base(...) syntax are called "constructor initializers" in the language spec

brazen aurora
#

I have 2 canvases in my scene, one screen space camera one which i use to interact, and an overlay for settings. Is there anyway i can block the mouse from clicking through the ui to the gameobjects behind for the overlay canvas but not for the camera canvas?

median hatch
balmy vortex
#

hi is OnMouseEnter() and OnMouseOver() secretly really inconsistent or like what am I looking at
the player is supposed to insta die if they ever touch one of the bubbles (or hover over a flower for too long) but the bubbles just don't react 90% of the time and the flowers only register like 1 or 2 frames of being hovered over instead of however long they actually were hovered over

#

tried doing raycasts too but that didn't work at all

#

I might just be stupid or smth but yeah

#

||flowers being the red circles and bubbles the blue ones for context if that wasn't clear enough already btw||

#

if anyone could maybe help that'd be awesome

frail hawk
#

i think a rc would be much more precise in this case

balmy vortex
frail hawk
#

raycast

#

wait is it not already using rc under the hood

grand snow
frail hawk
#

means they´d have to change to ui elements then

grand snow
#

no it works with 3d/2d physics colliders too

#

the monobehaviour OnMouse x functions also only work with the old input system so should be avoided

balmy vortex
rocky whale
#

does linearVelocityY always affect the direction parallel to Y axis or is there a way to make it go along with the rotation of the object

naive pawn
#

you can multiply your intended Y velocity by transform.up to get a local Y velocity, or with something like transform.InverseTransformVector (i think, check the docs on that)

wraith moon
#

https://pastebin.com/kzNcyac7
https://pastebin.com/aGdvbzLJ
https://pastebin.com/ZMz0c72K
https://pastebin.com/fzWv6zzL

for some reason the slot icons dont get defined (so far i only have weapons implemented)

wraith moon
#

this is meant to be a hotbar system

naive pawn
#

please only give the relevant bits of code, 6 files is a bit much

wraith moon
#

i have the system a bit spread out but i tried omitting a few files

#
    public Sprite hotbarIcon;   // ← NEW```
i have this in retroweapondata
naive pawn
#

what component/field is the issue here?
what do you mean by "slot icons" exactly?
what's the intended flow/behavior, how is the current behavior deviating from that

wraith moon
#

the component thats the issue is the icon here (HotbarItemIconUI)
it should ideally grab hotbarIcon from retroweapondata (which it should have access to thru hotbarsystem and then inventorsystem). unoccupied slots should be disabled until occupied (which is already happening), but it doesnt assign the weapon icons at all for whatever reason

#

nah im a dumbass i thought i had assigned the icons

lucid pendant
#
Unable to load font face for [PixelPerfectTinyFont]. Make sure "Include Font Data" is enabled in the Font Import Settings. You may disable it after creating the static Font Asset.
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

What on earth does UNITY want from me. Like just let me generate my asset for I can get my atlas....
Where are the god damm settings for this cannot find anything anywhere

lucid pendant
naive pawn
#

that doesn't mean this is the right place

#

do you think UI people would be checking the code channel

#

this one i can help with probably, but i'm not gonna do it here

brazen aurora
#

im trying to switch an audio clip in the script when theres a game over but for some reason the new audio clip just never plays, ive put audiosource.play() afterwards as well but it still just doesnt play

            music.Play();```
#

thats literally all im doing

naive pawn
brazen aurora
#

the code is definitely getting reached because the gameover screen is appearing.

        {
            timerStarted = false;
            timerPaused = true;
            time = 0;
            music.clip = musicClips[1];
            music.volume = 1;
            music.Play();
            gameOverScript.GameOver(Mathf.FloorToInt(timeElapsed / 60), Mathf.FloorToInt(timeElapsed % 60));
        }```
naive pawn
#

have you had it set to play something previously?

#

if so, does that other thing continue playing

brazen aurora
#

yes and no

naive pawn
#

are you sure musicClips[1] has content that's loud enough compared to your other audio

brazen aurora
#

yes because if i assign that to play first it will play

#

also i tried switching both clips and now when the gameover screen is reached a really loud buzzing sound plays

#

sort of like when you get a blue screen

naive pawn
#

what do you mean by "switching both clips" exactly

brazen aurora
#

switching them around in the array

#

so musiclips[1] is now musiclips[0] and vice versa

naive pawn
#

is this the only audiosource?

brazen aurora
#

i have another object with an audiosource that gets instantiated when i need to play it but those are the only two

frail hawk
brazen aurora
#

no i am using one audio source for the music and another for sound effects