#archived-code-general

1 messages ยท Page 154 of 1

leaden ice
#

You are recreating unity's built in event system

#

delete all of that code

#

and use the event system stuff

#

such as what boxfriend just mentioned

pure cliff
pure cliff
#

those have to be on monobehaviors, Im not in the context of a monobehavior here, Im in a POCO

#

for UI though looks like I will be forced to do event bubbling up, annoying but oh well

somber nacelle
#

this is why when someone asks you why or what you are trying to do you should provide the full context

leaden ice
pure cliff
leaden ice
#

have a MB which gets the ui event and forwards it to your POCO

pure cliff
#

yep, that looks like what has to happen

leaden ice
pure cliff
#

not the end of the world I just hate having to mix together Inversion of Control with normal direct composition

leaden ice
#

You call it obfuscation, I call it abstraction

#

We're not writing assembly here

pure cliff
#

SomeEvent?.Invoke(this, args)
Do you know what this will do? Do you have any easy way to tell at a glance in the IDE what this will actually invoke? You cant because you dunno if, or what, has subscribed to it until after its happened

leaden ice
#

It's a godsend that I don't know what it does

pure cliff
#

Thats why I hate events, you cant just F12 into em to be like "ah yeah it does precisely this"

leaden ice
#

I'm just announcing to the world that the player has died

#

i don't care what happens after that

pure cliff
#

yeah, it makes maint a living hell, speaking from experience

leaden ice
#

the stack traces are perfectly clean at runtime.

pure cliff
#

at runtime
exactly and what if you dont have the "runtime" :x

leaden ice
pure cliff
leaden ice
pure cliff
#

You have no runtime, and you have no stack trace, you just have an error report from users that "When I do the thing the other thing doesnt happen... sometimes"

pure cliff
leaden ice
#

no i reproduce the issue locally

pure cliff
leaden ice
#

If I can't reproduce any issue I'm basically SOL

#

IOC or no

pure cliff
#

at the core of it, events muck a lot up and make it hard to tell what is actually calling what, when you just have the code and no runtime from which the error was reported

leaden ice
#

Respectfully disagree, but to each their own

pure cliff
#

Sometimes though they are pretty much all you can do though, and it sucks but such is life

hasty haven
#

WOW guys, the solution earlier slightly helped ~10-20% but just using simple x,y,z int arguments instead of vectors for the addition reduced it down by ~80%

ashen yoke
#

are you testing in release mode?

hasty haven
pure cliff
#

I gotta figure out now how to cleanly integrate these events with my loop that is already checking for other kinds of input

vocal vector
#

hey, i am creating a car game in unity and i've just made a car controller that follows a torque curve, has gears etc. and my question is on how i can get it to drift? i want it to be more realistic drifting than arcade drifting. i'm using wheel colliders, so i've tried making the extremum slip value less, which causes it to drift, but it is too "arcadey"

ashen yoke
#

there are probably megabytes of whitepapers you can read on this topic

#

but i cant find any

vocal vector
#

yeah i've looked around quite a bit but i don't really understand how to implement it

ashen yoke
#

same, judging by car controllers on asset store that are being developed for years and still feel off, this is a massive thing

#

probably the secrets to good physics are passed by studios inhouse

vocal vector
#

yeah, for example carx drift racing is made in unity and they have awesome drifting. but they probably have their own car physics instead of wheel colliders

ashen yoke
#

wheel colliders are the worst thing in physx imo

#

i dont remember if i tested it

vocal vector
hasty haven
#

not if you dont want to reinvent the wheel sleeps knee

vocal vector
hasty haven
#

I was going to put a gif but its not allowed

#

means i made a bad joke

vocal vector
#

ahhh haha

ashen yoke
vocal vector
#

that looks awesome

weary hollow
fleet meteor
#

I know that you can pass messages into a WebGL unity instance and call functions on game objects, but can a WebGL unity instance send communication outwards to surrounding elements? For example, if scipt on the page could subscribe to events emitted by the unity instance?

leaden ice
#

which obviously can then do anything you wnt

fleet meteor
#

Thanks for that. So just checking my understanding- let's say that I was looking to display a scoreboard outside of the unity instance. I have some html element set up outside of the instance, and within javascript bundled with the webgl build I could locate that element on the page and pass it data from the game by calling the javascript from the C# script. Is that the general idea?

#

C# calls javascript function and hands it game data, javascript function bundled with the game finds the element and populates it?

shadow grove
#

Ok, so I have a AI enemy, which is programmed to follow the player, I have a script which spawns them over time, the script uses instantiate to clone the enemy, the enemy being cloned is in the scene, because the player is in the scene, so it knows what to track, when that original enemy is killed, no more enemys can spawn, because the original is gone, what do i do?

white gyro
#

Make the original a prefab

leaden ice
#

and it should not be in the scene
it should just be a prefab

white gyro
#

Simply drag the game object into a folder in the project window

#

And use that object in the folder as the original

shadow grove
#

Yeah but remeber if its a prefab then how does it get the players location

white gyro
#

You give the spawner a reference to the player

leaden ice
white gyro
#

Then the spawner will assign the player to the enemy ai script

leaden ice
#

Imagine this:
"Hello mr goblin. I have just summoned you. See that player over there? (points at the player) go kill him!"

#

but in code

shadow grove
#

yeah i been tryin that for an hour and havent got anywhere

leaden ice
#

IIRC someone walked you through it pretty in depth earlier

shadow grove
#

I know what i need to do, but not how to do it

leaden ice
#

it's only 5 or 6 lines of code tbh

shadow grove
#

yeah but he said i cant use anything that attempts to find the player

leaden ice
#

you don't need it

#

we just explained all you need

shadow grove
#

could you give me an example

#

it doesnt work

#

i still have a problem in the spawn script

leaden ice
#
public Enemy enemyPrefab; // assign in the inspector to the prefab from the project window
public Player player; // assign in the inspector to the player in the scene

void Spawn() {
  Enemy newEnemy = Instantiate(enemyPrefab); //spawn new enemy
  newEnemy.target = player;  // give a reference to the player to the new enemy.
}```
#

this is pretty much it

#

the important bits

shadow grove
#

target?

leaden ice
#

this would be on the spawner script

leaden ice
#

that points to the player

#

presumably you have a field on the enemy script that you are trying to assign to point to the player

shadow grove
#

hmmm

leaden ice
#

on the enemy script you'd have like:

public Player target;

void Update() {
  // move towards target here
}```
#

that's all

shadow grove
#

ok

#

public Transform player;?

#

thats what the enemy is trying to find

#

and kill

rigid island
#

Transform would work as well, but is better to use something more explicit on your player though like a Player component

#

all monobehaviours scripts have access to their object's transform & gameobject anyway

leaden ice
shadow grove
#

it said my enemy does not contain a definiton for player

leaden ice
leaden ice
shadow grove
#

ah ok

leaden ice
cobalt gyro
#

Is there a list that can store multiple values within 1 variable

leaden ice
#

you should already have it defined

leaden ice
#

a List

#

there are actually many different collection types in C#

#

lists, arrays, dictionaries, hashsets

#

and many many more

#

you can even write your own

ashen yoke
#

problem wise

cobalt gyro
#

i meant a list that can store a float and bool at index 0

shadow grove
#

it does

leaden ice
#

make a struct

#

or class

#

that contains a float and bool

#

and make a list of those

leaden ice
shadow grove
#

im saying that if the enemy is cloned(newEnemy), how would i acess newEnemy's Player Target

leaden ice
#

try to remember

shadow grove
#

i have the prefab assinged, its whats in the script i need

ashen yoke
#

there are several ways to do that

#

all of them require a singleton in one form or another

#

the simplest way for you to achieve that, is to have a singleton that acts as a "service locator"

#

you already encountered such locators, for example GetComponent<T> is a service locator

#

which locates a component on a game object

#

in your case you need a global one

shadow grove
#

yeah but don told me not to use that because it takes away from performance

ashen yoke
#

or at least scene scope one

rigid sequoia
#

Hi

ashen yoke
rigid sequoia
#

I really want to learn how to use unity, I'm really looking forward to learn how to code

#

Do you have any recommendation?

ashen yoke
#

start with isolated c#

#

visual studio, console application, do online pure c# tutorials

#

learn to make simple game in the console

#

learn basics of c# and programming

cobalt gyro
leaden ice
#

it;'s doing exactly what you're asking for

rigid island
cobalt gyro
#

also a great resource

cobalt gyro
rigid sequoia
#

Okay so basically I need to learn C#, I'll watch those resources!

rigid island
rigid sequoia
#

After learning C# what's next

rigid island
#

that was a huge turnoff for me in early days like XNA

ashen yoke
#

unity learn has 750+ hours of high quality courses

rigid sequoia
#

4 free?

rigid island
#

it evolves every day

ashen yoke
rigid sequoia
#

cool

cobalt gyro
rigid island
#

ew that's taking a step back imo xD

shadow grove
#

holy crap i did it

ashen yoke
#

you never stop learning sure

rigid sequoia
white gyro
#

dont just learn the language, learn the fundamentals. that way whatever you learn in C# you can apply in other languages

ashen yoke
#

but jumping into unity is akin to accelerating a car in 5th gear

rain minnow
shadow grove
#

@ashen yoke i used GetComponent to get acess the the player transform

#

is that what u meatn

ashen yoke
#

GetComponent was an example of what i was talking about

shadow grove
#

ok

#

this is what i di

shadow grove
#

GameObject newEnemy = Instantiate(enemy, new Vector3(Random.Range(-5f, 5), Random.Range(-6f, 6f), 1), Quaternion.identity);

        newEnemy.GetComponent<EnemyAi>().target = player;
rigid island
#

and skip GetComponent

#

EnemyAi newEnemy = Instantiate(enemy, new Vector3(Random.Range(-5f, 5), Random.Range(-6f, 6f), 1), Quaternion.identity); newEnemy.target = player;

pure cliff
#

Does OnPointerExit always fire off before OnPointerEnter for 2 different objects?

white gyro
#

In my experience, yes

shadow grove
#

the hell is a singleton

pure cliff
#

Lets say I have 2 gameobjects touching side to side, no gap, and mouse is hovering over A atm, it leaves A to hover over B, causing both PointerExit for A and PointerEnter for B, is it actually safe to rely on PointerExit firing first?

shadow grove
#

if i try newEnemy.target = player; it gives me this

shadow grove
pure cliff
rigid island
#

whats on that line

white gyro
shadow grove
#

doesnt work either

rigid island
#

you're not accessing .target on EnemyAi and instead trying to do it on GameObject for some reason.

#

at least that's what error seems to say

shadow grove
#

ok

#

here

#

!code

tawny elkBOT
#
Posting code

๐Ÿ“ƒ Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

๐Ÿ“ƒ Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

shadow grove
rigid island
#

holy shit this code formatting..

shadow grove
#

yeah

#

i havent really focused on that

rigid island
#

why did you remove GetComponent<EnemyAi >

#

if you gonna remove it you gotta use it like i said earlier

#

you'd have to change Both GameObject to EnemyAi

#

if (GameObject.FindGameObjectsWithTag("Enemy").Length < 10)

You could probably store enemies in a List instead of doing this every spawn

#

but you probably haven't used list before ๐Ÿ˜…

shadow grove
#

yeah the other thing didnt work

rigid island
#

it does work

shadow grove
#

the enemys just stand still and wont clone

#

i will just use get component for now if that ok

rigid island
#

the getcomponent has nothing to do with your issue

#

you will see the same issue.. it's something else

shadow grove
#

it works with getcomponent

#

perfectly fine

rigid island
#

still dubious that's what did it

#

spawning as EnemyAi is the same exact thing.

shadow grove
#

i am cloning a prefab, which is what enemyPrefab, and you told me to change the from gameobject to the enemyai class from the other script

#

it will not know what to spawn

rigid island
#

I been doing this for years, I'm sure I know how it works lol

shadow grove
#

here i send you what works and what doesnt, ok?

rigid island
#

your spawning is just weird to me

rigid island
#

I bet you didn't change one of the types, particularly the method parameter

#

probably getting NRE not even realizing

shadow grove
#

work perfectly fine

rigid island
#

ok now the broken one ๐Ÿฅ

shadow grove
rigid island
#

you had to remove the old prefab

#

it still had it stored as GameObject

shadow grove
#

lemme try

rigid island
#

if you deleted it and put prefab again it will work

#

trust

shadow grove
#

it worked

#

how does it spawn the prefab through a class? Im curious

rigid island
#

haha yeah forgot that bit .. haven't used GameObject type in ages

rigid island
shadow grove
#

so it just spawns whats attached to the script?

rigid island
#

Instantiate returns an Object

#

you're telling "I want this type from it"

shadow grove
#

so yes?

rigid island
#

yea if the script inherits from Object

#

which any MonoBehaviour does

shadow grove
#

i should prob remove the serialized field and make it private so i dont get confused

#

Should i*

rigid island
#

no because you won't have a way to set the prefab of that type

shadow grove
#

but it is just set to none

rigid island
shadow grove
rigid island
#

wait why is it empty lol

#

you should have you prefab there

shadow grove
#

it is not a gameobject

#

so i just see this

rigid island
#

the Prefab has the EnemyAi script on it yes?

#

so it's the EnemyAi type.

shadow grove
#

oh wait i can select the script

rigid island
#

you drag in the prefab that has that script yes

shadow grove
#

if it is set to none will it apply to all gameobjects with the script?

#

ignore the weird prefab name

rigid island
#

if it's set to blank you're just gonna get a NullReferenceException

shadow grove
#

huh

#

welp

#

what matters is it works

rigid island
#

I'm confused wat you're asking, why would you set it to blank.

#

esp if it's working now

shadow grove
#

oh no i am keeping it on the prefab

#

im just saying it just matters that it works

rigid island
#

oh ok ๐Ÿ˜…

shadow grove
#

wait

#

the prefab not in the scene doesnt show up in the assets area for the selection but if i drag and drop it it works, ???

spring creek
#

Prefabs don't need to be in the scene, which is one of their benefits. Think of them as blueprints, or templates
By assets area do you mean hierarchy? it should be in the project window where assets are. Where else would you drag and drop it from?

shadow grove
#

look

#

however i can still drag and drop a prefab in

#

and it works

#

could be a bug

#

idc tho

light rock
#

is your field GameObject? or something else

spring creek
#

Honestly, I've never seen that Assets window before. So I have no idea lmao. Feel dumb right now
If it's in the project window, you're fine.

light rock
#

because this menu notoriously is unable to find components on prefabs - it can only find root level objects in the assets folder

spring creek
shadow grove
#

thx navarone

#

just wanted a answer

#

And thanks alot for all ur help ur the best

rigid island
#

I could never get that thing to find prefabs in assets folder even though it has that button for it

shadow grove
#

navarone do u make games

rigid island
#

sometimes jams

light rock
#

unfortunately unity says this box failing to find objects is "by design" becaues apparently it would be too performance heavy..?!?!?!

ashen yoke
#

yes

#

and early versions of QuickSearch are showing why

#

you have to scan/cache everything in every prefab in the project for it to work

#

if you dont do that you have to go through all the prefabs every search, loading them all into memory

light rock
#

the thing is is - id rather it be slow than not work at all. id rather have unity hang up for 1000 ms than search for the asset i want by hand which would take 20 times longer

ashen yoke
#

quicksearch package is a thing

light rock
#

uh huh

#

not really a good argument

ashen yoke
#

argument on what

#

you wanted a feature by unity, you got it

#

made by unity

#

Quick Search

light rock
#

does quick search fix the asset box not finding every object?

ashen yoke
#

you can type into google "unity quick search"

#

and read the doc

rigid island
light rock
#

in an unrelated note. has anyone had this issue about OnValidate()? i have an scriptableobject that uses OnValidate, and it works perfectly fine in the editor. but for some reason when i build my game, the fields of the scriptable object that i populate in OnValidate() aren't being serialized.

#

i found this thread online

#

but their issue was that they weren't using [SerializeField]

#

but im definitely using serializefield, so im not sure if this issue is related

ashen yoke
#

so it works, finds components in prefabs

#

with limitations but it works

light rock
#

it's a good replacement functionality, but it still doesn't fix the asset box in the object picker. i dont know why they dont just use quicksearch's code to replace the broken code in the object picker

ashen yoke
#

any non inspector changes that arent done on serializedProperty wont be saved unless you mark the object as dirty and then save project

ashen yoke
light rock
#

i will try using SetDirty, thanks

ashen yoke
#

they wont disrupt workflow for thousands of users with something that has the potential to slow the whole thing to a crawl

light rock
#

i dont see how it would be any different than using quicksearch other than the button being in a different place

ashen yoke
#

yes it wont be, thats why quick search is available for you to use, if you need that functionality use quick search

#

this gives you and everyone a choice, use default fast way to access data that works for most cases, or if you need to do slow search use quicksearch

light rock
#

use the default fast way when it actually works (textures, prefabs, etc) and default to using quicksearch when the field type is a component (instead of failing to find anything)

ashen yoke
#

so install quick search and use it for finding components?

#

youve never used it, so you assume its going to work same way as default one

#

it doesnt, every time a change is made to anything it scans objects to build the cache

#

its not just slow when you press a button to open something, it slows down the whole workflow

#

it affects you even when you are not searching

#

and to me it doesnt look like an issue that can be solved easily, unless they manage to integrate it into native code

light rock
#

idk about you but im running 2022.2.8f1 and i have quicksearch available but its not in my package manager

#

did they make it included by default?

ashen yoke
#

its built in for you?

#

i havent used latest versions

light rock
#

i mean maybe theres a way to disable it but its not a package anymore

#

wait wait wait

#

does this do what i think it does

ashen yoke
#

Initially released in version 2021.1, Search has since become a core workflow

light rock
#

WOWIEEEE

ashen yoke
#

so yeah they moved it to core

light rock
#

well problem solved

#

my current project isnt really big enough to be slowed down but do people experience issues with quicksearch?

ashen yoke
#

i only tested early versions and they slowed everything down dramatically

light rock
#

when i did this just now it stopped for a second the first time i searched for this type, but after the first time searching is instant

rigid island
#

indexing prob

shadow grove
#

Hey navarone i had the same prob with some score text and having the prefab have the text assigned and i got it to work with my prior knowledge

white gyro
#

Is there a name or term for Unity's GameObject-MonoBehaviour paradigm

prime sinew
#

OOP? composition?

white gyro
#

I guess composition works

#

I used to think it was some sort of butchered ECS paradigm

#

Then they added the real ECS

#

Maybe it's just Entity-Component

bleak thorn
#

It is the same code?

prime sinew
#

If you don't put braces {}, the if statement only covers the first line after that

#

Better to use braces to avoid silly mistakes

spiral dagger
#

Correct

prime sinew
#

Right now they're the same

#

But if you wanted to also have the debug.log be covered by the if statement, you need to wrap both lines in braces

#

I hope you understand

bleak thorn
#

Yeah, thank you

prime sinew
#

You're welcome

west lotus
#

Once you go the route of having managers manually update monos you get close to ecs

#

We have a system like this, but with jobs and a custom player loop. In terms of performance its close to ECS, the only downside is getting the data back to the monos or god forbid destroying more than 500 per frame

#

But pools fixed that for the most part

gray mural
#

is there any method that's called in DDOL when scene is changed?

#

or do I call smth manually?

#

oh, wait, no, I don't even need it

#

if I have 2 same ddols, then 1 will call Awake

#

and I can do everything there

#

nice

prime sinew
#

It being a DDOL object is irrelevant

gray mural
#

but it doesn't matter

#

I just do everything in Awake

#
private void Awake()
{
    if (!GameObject.FindGameObjectWithTag("#ScriptsHolder"))
        DontDestroyOnLoad(gameObject);
    else 
        Destroy(gameObject);
}
quartz folio
#

This really seems like you should just use the singleton pattern instead of Find

gray mural
quartz folio
#

google Unity singleton

gray mural
#
if (Script.instance == null)
#

this?

#

I see

#

doesn't make too much sense for me

craggy veldt
#

wdym? it's a common thing todo with Singleton pattern

gray mural
#

also #ScriptsHolder has multiple scripts

craggy veldt
#

yet again in your snnippet you're only looking for 1 of them, no?

gray mural
#

oh, scripts

#

I see

#

nah

#

I has 2 scripts

#

I just have to disable that gameObject

thin aurora
#

If you have issues with retaining gameobjects depending on what happends in your game, then maybe it's a good idea to create a dependency system that tracks certain lifetimes. I always create a manager that tracks gameobjects that should only appear once and persist through scene changes, but also tracks gameobjects that should be recreated when a scene has changed. You can then just request a dependency from that manager, instead of trying to find it yourself.

gray mural
#

I want to have #ScriptsHolder is host mini game engine to create levels (that just I can create for now) and also in MainMenu that's available for players

short walrus
#

anyone got a moment?
im having trouble assigning proper rotation angles to 2d npcs...

here's part of the code that handles it

        else // if (rot_type == "move_DIR")
        {
            if( !spawn_angle)
            {
                Debug.Log("spawn_angle");
                direction = new Vector3( transform.position.x + Random.Range(-1f, 1f), transform.position.y + Random.Range(-1f, 1f), 0f);
                prev_direction = direction;
                spawn_angle = true;
            }
            else
            {
                Vector2 movementDirection = rb.velocity.normalized;
                if (rb.velocity != Vector2.zero)
                {
                    direction = new Vector3(movementDirection.x, movementDirection.y, 0f);
                    prev_direction = direction;
                }
            }
        }

        float rotation_speed = 10f; // og
        direction = direction.normalized * 1.1f;
        Quaternion targetRotation = Quaternion.LookRotation(Vector3.forward, direction);
        rb.rotation = Mathf.LerpAngle(Prev_rotation, targetRotation.eulerAngles.z, rotation_speed * Time.deltaTime);
        Prev_rotation = rb.rotation;```
#

what doesnt work is the spawn_angle part

#

while it runs one time, the direction isnt properly set, the rest of it seems to work ok

swift salmon
#

hmmm, can anyone help me about procedural meshes? I know how to create them from triangles, but I am in a need for an algo, that finds those triangles out of a shape, that can be concave as well as convex...

swift falcon
# bleak thorn It is the same code?

I usually don't use braces myself for if statements

But I suggest if you want to do that and if ur "Fairly new" to keep them on 1 line with the if statement for now (If you plan to not use braces)

#

how is this not working

#

"the name test does not exist in the current context"

vagrant blade
#

You need to assign a value inside a function.

swift falcon
#

No, I can't reference anything

#

I could reference stuff in other scripts, but now when I made this new one, nothing works.

vagrant blade
#

Code logic has to go inside of functions.

#

You may want to do some tutorials on basic coding.

swift falcon
#

there we go

#

code logic inside a function

vagrant blade
#

And where is the function that you're calling?

swift falcon
#

above sellallfish

vagrant blade
#

Share your code so we don't have to use our imaginations.

swift falcon
#

Excuse me?

vagrant blade
#

Not sure what part was confusing by that statement

swift falcon
#
    public void FunctionTest()
    {

    }

    public void SellAllFish()
    {
        FunctionTest();
    }```
vagrant blade
#

Share your code? You've already demonstrated some lack of basic understanding of coding, so just want to make sure the code actually is correct.

#

And what's the error that it's giving you?

swift falcon
vagrant blade
#

If it's a VS issue, make sure it's configured: !ide

tawny elkBOT
#
๐Ÿ’ก IDE Configuration

If your IDE is not autocompleting code
or underlining errors, please configure it:

โ€ข Visual Studio (Installed via Unity Hub)
โ€ข Visual Studio (Installed manually)

โ€ข VS Code*
โ€ข JetBrains Rider
โ€ข Other/None

*VS Code's debugger plugin is unsupported.
We recommend using VS or Rider instead.

swift falcon
swift falcon
gray mural
#

Hello, let's image I have a game, where I create levels. Should I have 1 json file to save all levels e.g. Levels or seperate json file for each level e.g. Level1, Level2, Level128?

cosmic rain
tawny elkBOT
#
Posting code

๐Ÿ“ƒ Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

๐Ÿ“ƒ Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

cosmic rain
#

What data about them do you need saved?

gray mural
craggy veldt
cosmic rain
gray mural
#

GameObjects

cosmic rain
#

Why do you need them saved?

#

Are they moved?

gray mural
craggy veldt
#

also depends, sometimes it's needed for them to be saved separately. Also depends on the scale of your game

gray mural
gray mural
#

probably

cosmic rain
gray mural
#

they are not programmers

cosmic rain
#

You don't need to be a programmer to edit a text file.

gray mural
#

they will enter game and drag prefabs

gray mural
cosmic rain
#

Then it doesn't really matter how you save them.

gray mural
#

and each user should have this json file

#

but for now just me

#

The next question is: where do I save json files for my game

#

I think I shouldn't save all those files on my pc

#

like database probably?

cosmic rain
gray mural
cosmic rain
#

Oh, was cloud an option?๐Ÿ˜…

gray mural
gray mural
cosmic rain
gray mural
#

I have never worked with clouds or databases

gray mural
#

I just wanted to ask where those things are done.

#

e.g. I have 1000 players in my game and all they have made multiple levels

#

and I should save all their levels in jsons

cosmic rain
gray mural
#

they create level and it's automatically saved

cosmic rain
#

Then in the persistent data path is good enough.

lean sail
gray mural
#

like probably foobar123.json

lean sail
#

Storing it in 1 is risky, and really just more work

gray mural
lean sail
#

When you make a level, you'll need to edit that json rather than making a new file. If someones file gets corrupt they lose out on 1000 levels rather than 1

gray mural
#

I haven't thought about that

#

but still I have to save them somewhere..

lean sail
#

And when its uploaded by a user anyways, itll just be a file containing only their level. So itll already be an individual file, you would just be copying it to 1 for almost no reason

lean sail
#

Then just make sure the names are unique

gray mural
lean sail
#

You could even just prefix them with an index plus the name the user actually gave, which would solve the issue of duplicate names

gray mural
#

I don't think I should save them all on my pc

#

or should i..?

lean sail
#

Well you'll need to download the actual level if you want to play it

#

But depends on the game where you want to store every single level

#

Steam has it's own workshop where users can upload stuff like this

#

I dont know much about alternatives

gray mural
#

if so.

#

let's imagine users have created 1.000.000 levels and all they are stored on my pc

lean sail
#

Well a user wouldnt upload a file and have it immediately download on your pc

craggy veldt
lean sail
#

You would use steam workshop or whatever alternative you find, and only download the ones u want to play

craggy veldt
#

which technically has the same limitation as having single (1) file ๐Ÿ˜ƒ

cosmic rain
lean sail
gray mural
lean sail
gray mural
#

admin's

#

If I have created a game, then I'm host

#

and there are other players that create levels

quartz folio
#

This is once again having a giant nonsense convo that stems from the fact you barely explained what exactly you meant before you started

#

People can't give you advice if you just ask something vague and then say "no not like that" over and over again

gray mural
#

haven't I?

cosmic rain
lean sail
#

But I know that's not the case

quartz folio
#

it's just moving the goalposts, but completely out of ignorance instead of argument

#

Hello, let's image I have a game, where I create levels. Should I have 1 json file to save all levels e.g. Levels or seperate json file for each level e.g. Level1, Level2, Level128?
You create levels?
No, the users are creating levels!
Saving them?
No, this is over the network!
Where does it start and end??

gray mural
# cosmic rain Where do you **want** these files stored and why?

I create my game and I make players of my game to be able to create levels.
apple123 can download my game and start creating 3 levels. also other 1000 users start creating levels.
Every time those users enter the game, they can see what levels they have created.
They can post their levels for others to be able to download and play them.
So let's imagine there are 5000 levels created by users in total.
These levels should be saved somewhere, the same like all my scripts that I have created are save on my pc somewhere in Assets file.
Where are all those levels saved? Should they also be saved on my pc and when player wants to play a specific level, they should download it on their pc too?

#

I really hope I have succeeded in explaining it

quartz folio
#

They are saved only where they are needed to be saved. If a player wants to know about the levels they created, then they probably will have them on their computer, as with anything they downloaded. If a user wants to post a level, then it's uploaded to a server.

gray mural
#

๐Ÿ™„

#

like maybe I should use database to save all users data and their levels...

#

probably that's what I need

vagrant blade
#

Yes you should

#

Something like Playfab for example

gray mural
#

is it most commonly used database for unity?

vagrant blade
#

Nobody would know the answer to that

gray mural
vagrant blade
#

It works with Unity ๐Ÿคทโ€โ™‚๏ธ

#

Maybe do some research and look at your options.

quartz folio
#

Literally any database service you can think of is reliable

lean sail
#

If it's just a server for storing json, itd have no effect if this was unity, python, or anything

gray mural
#

cuz I have never

lean sail
#

I'd say the most common would still probably be steam, with its workshop

#

Or at least the most well known

quartz folio
#

If this is the first proper game you've made, it sounds very overscoped

gray mural
vagrant blade
#

_this time will be different _

winged mortar
#

Surely I can do everything I ever wanted in this game

#

Learning development + unity + databases + multiplayer

#

Wait hols up authentication

gray mural
quartz folio
#

You didn't know how to save a file yesterday, and found it difficult to research, I don't know how you're gonna figure out a database

gray mural
#

and this time will be enough to learn

swift falcon
#

limited scope is always good idea

lean sail
#

I've been coding for 9 years, and I can proudly say i too have over scoped my project by trying to make a multiplayer physics game.

#

Its never enough time with learning multiplayer

gray mural
lean sail
#

Or networking stuff in general

gray mural
swift falcon
#

iโ€™ve been coding for about 10 years and i still dont know jack shit

#

such is life

gray mural
swift falcon
#

you sweet summer child

#

it is never enough time

gray mural
#

yeah, maybe I will be working for 9 years on this project, who knows

quartz folio
#

Your first project should ideally be extremely short, designed to be throwaway, a learning opportunity and nothing more

gray mural
#

I had some little projects before

gloomy stirrup
#

can anyone tell why this given no error and dosnt work at the same time ? using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class GameOver : MonoBehaviour
{
private AudioSource audioSource;

public void start()
{
    audioSource = GetComponent<AudioSource>();
}

// This function is called when the player collides with the trigger object.
private void OnTriggerEnter2D(Collider2D other)
{
    // Check if the colliding object is the player (you can use tags or layers to identify the player).
    if (other.CompareTag("Obstacle"))
    {
        Debug.Log("Collision");
        audioSource.Play();
        Destroy(gameObject);
        Invoke("Restart", 1.5f);
    }
}

public void Restart()
{
    SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
quartz folio
#

Whatever it is, it's one of your first

swift falcon
#

!code also?

gloomy stirrup
#

and yea idk those website for code pasting... they just doesnt work

tawny elkBOT
#
Posting code

๐Ÿ“ƒ Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

๐Ÿ“ƒ Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

quartz folio
gray mural
gloomy stirrup
gloomy stirrup
gloomy stirrup
#

ok thanks

quartz folio
gloomy stirrup
#

oh ahem

quartz folio
gloomy stirrup
#

ok

#

well the script still doesnt works

quartz folio
gloomy stirrup
#

I mean its not colliding

#

but it seems to be colliding in the play mode

quartz folio
gloomy stirrup
#

yeah but nothing works\

#

btw does this have problem with that ?

#

objects are not on the same axis on z axis

#

@quartz folio

quartz folio
gloomy stirrup
#

hm ok

echo zinc
#

Can anyone help me?

#

please

#

im stuck on this thing for 2 weeks

gloomy stirrup
quartz folio
gloomy stirrup
#

I went there

#

and then went to their specific site

quartz folio
#

Why are you looking at collision messages if you are using a trigger message?

gloomy stirrup
#

I am using a collison msg

#

private void OnTriggerEnter2D(Collider2D collision)

quartz folio
gloomy stirrup
#

wow.. nice.. well that dumb I am

quartz folio
#

But like, if you thought you were using a collision message then you would see from that page that what you'd written was wrong, and you would change it to match the collision setup

gloomy stirrup
#

no.. I was lokkin into that

#

collision

#

Collision2D collison

#

to check if thats correct

#

well new problem... Collision doesnt contain CompaerTag

rigid island
gloomy stirrup
#

ok thanks

rigid island
#

a loop

#
 private void Repeat()
    {
        int timesToRepeat = 8;
        for (int i = 0; i < timesToRepeat; i++)
        {
            Debug.Log("Repeat only certain amount");
        }
        while (true)
        {
            Debug.Log("Some infinite loop");
        }
    }```
#

is just an example, yeah why would it not work if you reset scene

#

do you plan on using this for an enemy spawner?

#

you should probably put it in a coroutine with a timer

gloomy stirrup
#

it worked finally hehe

rigid island
#
bool spawningEnemies = true;
    float timeTillNextSpawn = 1;
    private IEnumerator Repeat()
    {
        while (spawningEnemies)
        {
            yield return new WaitForSeconds(timeTillNextSpawn);
            //spawn
        }
    }```
stable osprey
#

what happened to scripts-only build in late unity versions?

#

I was under the impression it got integrated to the standard 'build' system when development mode flag was checked, but this doesn't seem to be the case (?)

rigid island
#

Repeat() method is the Coroutine

#

hence IEnumerator

violet wyvern
#

Hey guys I am trying to generate a board at runtime that has different sprites assigned each square using the same prefab. It works but it is overlapping. I had a method when the the prefab sprite was not null but it doesn't work anymore to space properly next to each other. ```void GenerateGrid()
{
Vector3 boardPosition = transform.position; // Get the position of the Board object

    float squareSize = squarePrefab.GetComponent<SpriteRenderer>().bounds.size.x; // Get the size of the square prefab

    for (int x = 0; x < gridSize; x++)
    {
        for (int y = 0; y < gridSize; y++)
        {
            Vector3 spawnPosition = boardPosition + new Vector3(x * squareSize, y * squareSize, 0f); // Calculate the spawn position relative to the Board object
            GameObject squareObject = Instantiate(squarePrefab, spawnPosition, Quaternion.identity);
            squareObject.transform.parent = transform; // Parent the square object to the board object
        }
    }
}``` I tried adding a coroutine but I don't think I got it right
winged mortar
#

Also you can pass the parent transform as a parameter to instantiate

violet wyvern
#

I am currently not using the above code since the prefab is null at run time

#

It doesn't seem to work anymore

#

Since it can't get the sprite size

winged mortar
#

Okay then its probably ran before the sprite gets assigned right?

#

Are all the sprites the same size?

#

Because they look like different sizes

violet wyvern
#

Yeah all same size

#

1080x1080

winged mortar
#

If you are not using the code above, then you should probably post the code you are using now

plain nebula
#

how can i determine the .net framework a unity mono game uses?

winged mortar
violet wyvern
#
    {
        StartCoroutine(GenerateGrid());
    }

    IEnumerator GenerateGrid()
    {
        // Wait until the SpriteRenderer component and its sprite property are not null
        while (fieldPrefab.GetComponent<SpriteRenderer>() == null || fieldPrefab.GetComponent<SpriteRenderer>().sprite == null)
        {
            yield return null;
        }...// Calculate the size of each field based on the size of the sprite and the scale of the prefab
        float fieldSize = fieldPrefab.GetComponent<SpriteRenderer>().sprite.rect.width * fieldPrefab.transform.localScale.x;

        // Instantiate the fields on the game board
        for (int x = 0; x < boardLayout.GetLength(0); x++)
        {
            for (int y = 0; y < boardLayout.GetLength(1); y++)
            {
                FieldType fieldType = this.board.GetFieldTypeAt(x, y);
                Vector3 position = new Vector3(x * fieldSize, y * fieldSize, 0f);
                GameObject instance = Instantiate(fieldPrefab, position, Quaternion.identity) as GameObject;
                instance.transform.SetParent(boardHolder);
                instance.GetComponent<SpriteRenderer>().sprite = fieldType.Sprite;
            }
        }```
winged mortar
#

Ideally you dont do this

#

Like at all

violet wyvern
#

Oh

winged mortar
#

How is fieldPrefab being set?

violet wyvern
#
{
    public GameObject fieldPrefab;
    public Transform boardHolder;```
winged mortar
#

Set from the insepctor?

#

Aha

#

You are referencing your prefab asset and not an instance for the prefab

#

So whatever sprite you load into the prefab at design time gets used for the bounds calculation

#

You should instantiate a prefab for every cell in your grid

#

And you can just pick the first one for the size of the sprite

#

So if you add a fieldSize = instance.GetComponent<SpriteRenderer>.bounds.size.x in there it should work

violet wyvern
#

Hey thanks a lot for all this info! I will go try it

winged mortar
#

Remove the coroutine

#

And the while check for the null

#

And set the fieldsize to 0 initially

violet wyvern
#

Worked like a charm

plain nebula
winged mortar
winged mortar
violet wyvern
#

Now help me develop the rest of the game @winged mortar

rigid island
#

what exactly doesn't work ?

plain nebula
winged mortar
plain nebula
#

oh ok

#

sorry

mossy shard
#

Hello, when using Application.persistentDataPath i get an error about the permissions of the creating another file using :

  FileStream stream = new FileStream(path, FileMode.Create);

  EntityData data = new EntityData(player);

in the ,,DefaultCompany" folder.

i would instead want to make the pathing another, like using a string from code and make it universal since i cannot for the life of me find the issue (yes i set the permission of the folder to everyone, no i don't have spaces).

So how would i go about creating a universal file path? without using ,,Application" class

#

im sick of trying to solve this at this point

rigid island
#

how and where are you calling this method ?

winged mortar
rigid island
#

function?

winged mortar
#

It could also be that your path is too long

mossy shard
#

lemme send the error

rigid island
winged mortar
#

It might also be worth trying to build your game and run that as administrator

mossy shard
rigid island
mossy shard
#

can you teach me?

#

okay i understand

rigid island
#

having to tell all players to switch to admin to run game is silly

mossy shard
#

but the editor doesn't support administartor as i know

winged mortar
#

Its not but it can help identify the problem ;)

rigid island
mossy shard
#

could you elaborate?

rigid island
#

eg .txt

#

or w/e you're saving as

mossy shard
#

reall-

#

lemme see

rigid island
#

mhm

#

also don't use whitespaces

mossy shard
#

nothign wrong here btw?


#
 public static void initializePaths()
    {
        paths[0] = "/saveFile1.txt";

        paths[1] = "/saveFile2.txt"; 
    }
rigid island
mossy shard
#

lemme send full code

#

ok?

rigid island
mossy shard
rigid island
#

whitespace and it's missing the file extension

rigid island
#

!code

tawny elkBOT
#
Posting code

๐Ÿ“ƒ Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

๐Ÿ“ƒ Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

mossy shard
#

the files that created

#

after pressing 2 saves

rigid island
#

I see the folders

mossy shard
# rigid island yea
 static string[] paths = new string[10];

    public static void initializePaths()
    {
        paths[0] = "/saveFile1.txt";

        paths[1] = "/saveFile2.txt"; 
    }

    public static void save(Player player, int saveID)
    {
        BinaryFormatter formatter = new BinaryFormatter();

        string path = Application.persistentDataPath + paths[1];

        FileStream stream = new FileStream(path, FileMode.Create);

        EntityData data = new EntityData(player);

        formatter.Serialize(stream, data);

        stream.Close();
    }
#

sorry but i like discord's code conv xd

rigid island
mossy shard
#

ye

#

this morning i made it

winged mortar
mossy shard
#

i got paths[1] because i wanted to test

winged mortar
#

Or Path.Combine

rigid island
mossy shard
rigid island
mossy shard
#

I-

rigid island
#

and save

mossy shard
#

oh damn

#

you are right i don't call it

rigid island
#

nicee

mossy shard
#

lemme see now

rigid island
#

so a null destination

winged mortar
#

Just do this next time man @mossy shard

int[] array1 = new int[] { 1, 3, 5, 7, 9 };
#

No method required

white gyro
#

you can also just do

private static string[] paths = new string[]
{
  "saveFile1.dat", "saveFile2.dat"
}
#

beat me to it

mossy shard
#

it was just testing bro

#

will do this for the final product

#

@rigid island ehm

#

is this normal

white gyro
#

for a binary file yes

rigid island
mossy shard
#

ye

mossy shard
rigid island
#

yeah not really good to serialize though

mossy shard
#

OH ye

#

i forgot

rigid island
#

also don't use BinaryFormatter

mossy shard
white gyro
#

what is EntityData

#

depending on how complex it is you might just get away with plain text

rigid island
white gyro
#

if it's really simple just use newtonsoft.json

mossy shard
#

but i got mostly commented out for only position so i could test

mossy shard
#

why this happens?

white gyro
#

can you upload your entity data class

mossy shard
#

it's literally a vector with 3 positions rn

#

lemme jesut upload it

rigid island
# mossy shard why this happens?

idk I don't use binary formatter lol
probably something to do with what you're serializing a whole gameobject which isn't very good

mossy shard
# white gyro can you upload your entity data class
 public float[] position;



    public EntityData(Entity entity)
    {


        position = new float[3];

        position[0] = entity.transform.position.x;
        position[1] = entity.transform.position.y;
        position[2] = entity.transform.position.z;

      
    }

rigid island
#

i suggest you format it into JSON or something

mossy shard
#

this is what i am saving

mossy shard
#

ig this is this issue

white gyro
mossy shard
rigid island
white gyro
#

yeah i saw your channel too

rigid island
mossy shard
rigid island
#

but do you really care what players change in their own game?

mossy shard
#

yes

winged mortar
#

You cant realistically stop that @mossy shard

rigid island
#

eh, if game is single player who cares how they play their game

white gyro
#

in my experience, you shouldn't worry about that until it becomes a problem

#

most people literally do not care about cheating

mossy shard
#

sorry misstyped

#

shouldn't you worry about something if it becomes a problem

#

isn't it like common sense

winged mortar
#

Even if it looks like garbage when openining it in notepad, people will just decompile your game and look at the classes that go into the binaryformatter and redo do it

mossy shard
#

anyways lemme see if it works now

winged mortar
#

There's so many save editors for games

white gyro
#

are people cheating in your game right now?

#

if no then it's not a problem

mossy shard
mossy shard
#

wait

#

why did i respond to you

#

i wanted to respond to myself

#

sorry

#

@rigid island @winged mortar @white gyro thanksss, everything works now

#

i will think abt that

winged mortar
#

I didnt do anything but you are welcome ablobsalute

uncut plank
#

does Invoke let you call a function delayed by one frame rather than a time in seconds?

potent sleet
uncut plank
#

yes

#

MonoBehaviour.Invoke

potent sleet
#

use IEnumerator

uncut plank
#

what should I use instead?

#

alright

fair wadi
#

okay so I just downloaded an endless runner template from Unity and after playing around and adding a few things I thought I would change the art but for the life of me I could not figure out how, I don't really know what screen shots would help but if anyone knows how to do this any advise would be apperciated!

wraith vector
#

is there a method similar to Physics2D.OverlapCircleAll that just finds what is overlapping with the collider? I'm sure I am overthinking this, massively, and I could probably just do something with "onCollisionEnter" but, yeah

void kite
#

Hi everyone!

So I'm making a splitscreen multiplayer game and I was wondering how can I go about making a spawn system when a player joins instead of the players spawning on top of eachother?

wraith vector
#

hmm it seems there is an overlapCollider method, but it works way differently. Wish there was just an overlapColliderAll method

#

this is such a weird way to do it, this method uses a list as a parameter, then stores the results in that list. Instead of letting you just set a new list equal to the results

buoyant crane
white gyro
#

it's not weird at all

wraith vector
#

I guess, but it works so different than the other ones

#

where you just define the list equal to what overlaps the square, or circle, or whatever shape you are using

white gyro
wraith vector
#

so I can just create an empty list at the start, and then use it for this?

white gyro
#

nvm i just changed the delegate to public delegate void EventHandlerWithParam(IEvent evt); and used that for the list

wraith vector
#

ok stupid question because I am having a brain fart

#

trying to think of how to word it though

#

ok so i have "private List<Collider2D> results;" do I need to give this a value before I can use it in that method? I know this is probably like, a really , really dumb question im sorry

white gyro
#

Which function are you using?

leaden ice
#

private List<Collider2D> results = new();

wraith vector
#

ok like, how do i word this

leaden ice
#

otherwise there is no list

wraith vector
#

ok ok

#

thats what I thought

leaden ice
#

if it was public you wouldn't need to do this because Unity would create it for you

#

(I'm not recommending you make it public, just explaining)

wraith vector
#

I just havent coded in a little over a year, so im having a few dumb dumb moments lol

dull thorn
#

Hey guys, I need help
I have created a small demo in Unity 2d, but when trying to destroy the game objects (basic game logic is - destroy moving objects)that are moving from above - on trigger enter is not destroy it. Looks like it's not on a similar layer. Does someone has similar issue?

leaden ice
dull thorn
dull thorn
#

Here is screenshots from the project

white gyro
leaden ice
#

!code

tawny elkBOT
#
Posting code

๐Ÿ“ƒ Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/

๐Ÿ“ƒ Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.

white gyro
#

wait maybe i just need to cast the event handler

dull thorn
white gyro
#

nope didn't work

leaden ice
#

and and which object is this script on and can you show the interaction where this isn't working?

spring creek
#

Bomb has trigger, and the enemy does not. Is bomb working as expected?

#

They both have the detect collisions script though

leaden ice
#

Are those prefabs ever instantiated?

#

What's going on

#

the collider radius seems pretty small, for example

#

make sure the colliders are actually overlapping

spring creek
#

And yeah the colliders are really small. Noticed that too.

dull thorn
#

Yes, they all prefabs - bomb is trigger. After bomb touch Enemy - enemy must be destroyed

spring creek
#

Does the bomb destroy itself? And the enemy remains? Or nothing happens

leaden ice
#

show the objects actually overlapping

#

and the inspectors of those objects at runtime

dull thorn
#

That's how it's looking - looks like enemy layer is above bomb layer and trigger can't see it. I have already increased radius, but it's still same

#

@leaden ice Any ideas?

wintry crescent
# dull thorn <@179367739574583296> Any ideas?

make sure:
at least one needs to have a rigidbody, ideally both
both are the 2D versions of colliders
make sure you're using OnTriggerEnter2D not OnCollisionEnter2D
Make sure the OnTriggerEnter2D code is on the object with the trigger collider (I think that's required?)

#

ah you posted screenshots earlier, didn't notice

leaden ice
# dull thorn

those objects are quite small and moving really fast

#

I wouldn';t be surprised if:

  • they are simply never overlapping due to speed and small collider size
  • they are never overlapping because the colliders aren't lined up with the sprites
dull thorn
leaden ice
# dull thorn

what layers are the objects on and how is your collision matrix in the 2d settings set up?

wintry crescent
#

@dull thorn in your OnTriggerEnter2D method, add a line like this
Debug.Log("Collision: " + gameObject.name + " with " + other.gameObject.name);
and show if console says anything

wintry crescent
#

it's in Edit->Project Settings->Physics, it's called Layer Collision Matrix, and it's at the very bottom

gloomy stirrup
sly gate
gloomy stirrup
sly gate
wintry crescent
gloomy stirrup
sly gate
#

then i dont know, apologies

gloomy stirrup
wintry crescent
sly gate
buoyant crane
wintry crescent
gloomy stirrup
sly gate
gloomy stirrup
gloomy stirrup
buoyant crane
wintry crescent
# dull thorn Nothing

try turning both into non-trigger colliders, and switch to using OnCollisionEnter2D, just for a test. Also make sure both rigidbodies have collision detection set to synchronous, and have "simulated" enabled - in case you're not using the rigidbodies to move.

buoyant crane
# gloomy stirrup ohk

You should also negate/invert the layermask as well. Otherwise it will only hit stuff on the โ€œplayerโ€ layer

buoyant crane
gloomy stirrup
#

ok

wintry crescent
gloomy stirrup
buoyant crane
#

Yes that makes sense

wintry crescent
buoyant crane
wintry crescent
dull thorn
#

@wintry crescent rigidbodies have collision detection set to synchronous - how to make it?

static matrix
#

I hate the kind of bug where its the king of bug where it seems like this should have already presented itself as a problem, but hasn't

static matrix
wintry crescent
#

not synchronous

gloomy stirrup
wintry crescent
buoyant crane
buoyant crane
#

When you are finished, we can invert the layermask

neon glen
#

I have a list of transforms for check points for where I want my Ai to go using navmesh. Im trying to make it so when i pick a transform from the list at random I can also check a bool to see if the checkpoint is taken already im really struggling on how this would work please help if you can ๐Ÿ˜„

gloomy stirrup
dull thorn
buoyant crane
gloomy stirrup
static matrix
#

ooh what does the ~ do

dull thorn
#

@wintry crescent Thanks a lot!

gloomy stirrup
gray mural
#

Hello, why I cannot access this namespace?

using Mono.Data.Sqlite;

I have installed SQLite

wintry crescent
#

if you're using transform, consider using rigidbody instead

buoyant crane
gloomy stirrup
#

ok

leaden ice
gray mural
#

I have downloaded SQLite database and dragged everything in Plugin folder I have created

static matrix
#

yooo fancy linkage

gray mural
static matrix
#

i havent mastered that new markdown yet

gray mural
#

but I still cannot access this namespace

static matrix
#

nice

leaden ice
#

regenerate project files

gray mural
gloomy stirrup
#

its working finally, thank you : ) @buoyant crane and @wintry crescent

gray thunder
#
#

Nice

gray mural
gloomy stirrup
gray thunder
#

its just a link to youtube

gloomy stirrup
#

but its embed

gray thunder
#

yes

gloomy stirrup
#

how

gray thunder
gloomy stirrup
#

oh

static matrix
#

is it possible to put a mesh on a canvas?

#

or like
a projection of a gameobject

static matrix
#

unfortunate
im trying to get a held item to work but it moves wierdly as I move the camera

gray mural
#

it also doesn't make sense

leaden ice
static matrix
#

hmm
wont that also render whatever is behind the object?

leaden ice
static matrix
leaden ice
#

canvases are UI

static matrix
#

well i know canvases are redered differently

static matrix
static matrix
#
 HandItem.transform.position = transform.position+Camera.main.transform.forward.normalized+(HandItem.HeldPos);

this is what I have so far

leaden ice
static matrix
#

ahAAAAAAAAAAAAAAAA I didnt know that was a thing

#

send me the doc

leaden ice
#

or

Camera.main.TransformPoint(Vector3.forward * offset)```
static matrix
#

ok

#

thank you

#

if this isnt on the camera script is Vector3.forward still correct or do I need another reference to tell that it is the cameras forward