#Flow's coding stuff

1 messages · Page 1 of 1 (latest)

broken crown
#

I'm learning! :D

primal shell
#

good job for deciding to learn C#

broken crown
primal shell
#

good job for deciding to learn Unity

broken crown
#

Okay, you don't need to be like that. I get what I said was stupid.

primal shell
#

it's not stupid

#

I am supporting you

#

feel free to ask some questions here

#

I have problems with communication and being "kind" to people, just imagine that I'm kind

broken crown
#

sorry, i interpreted what you were saying as you making fun of what I said.

primal shell
#

I wasn't, I am just kind

broken crown
#

It didn't work /:

#

I think it might be something like physics.onColliderEnter or MeshCollider.onEnter

#

This didn't work either ):

primal shell
#

that's quite logical I think

#

you have just created random method

broken crown
#

I figured it out, but I have a new problem

primal shell
#

Unity does have methods that you can use

broken crown
#

I never learned how to get properties from methods.

primal shell
#

it's written with "Unity Reference"

primal shell
#

also this question doesn't make sense

broken crown
#

Er, not methods

primal shell
broken crown
#

Oh

#

How do I get the collider from that?

primal shell
#

it won't be executed from Unity

primal shell
#

you click "Enter" and it makes you this method

#
private void OnCollisionEnter(Collision collision)
{
            
}
#

without parameter it's just another method

broken crown
#

I typed "OnCollisionEnter." but it didn't give me a list of stuff.

primal shell
#

it doesn't exist in your context

broken crown
primal shell
#

transform.SetParent does not take method as parameter

primal shell
broken crown
#

this is annoying

#

it can do this in visual scripting but not C# -_-"

primal shell
primal shell
#

hover SetParent method and see its parameters

broken crown
primal shell
#

click on method's name in window that appears when hovering it to look on its class

primal shell
broken crown
#

I'm trying to get the collider that touched this object's collider, and set it as the parent of this object

#

However I can't figure out how to get the collider

primal shell
#

you need to use it

#

there

#

in OnCollisionEnter

#

Collision collision is its parameter

#

it's called in Unity's built-in classes when collision happens

#

it contains all information about object you have collided with

broken crown
#

Like this?

primal shell
primal shell
#

please, use documentations when using unknown method

broken crown
#

I'm sorry if working with me is tiring and/or annoying, but at least I figured that tiny part out!

#

I was just confused because in visual scripting it was just this

#

and this was bad code

primal shell
#

which one is correct?

broken crown
#

Upper one; collider directly to transform

#

Visual Scripting does the conversion in the background in that circumstance

primal shell
#

it seems to have much less abilities

broken crown
#

It does, but QOL features like this are cool

primal shell
#

don't know, just don't like working with smth with small amount of abilities

#

even though I work with C#

broken crown
#

Lemme just

primal shell
#

you have error there, that's not because of your script

#

there is written everything in your error

#

it appers when colliding, yes

broken crown
#

Hey wait, if there's no target and parent arguments, how would I make this work?

primal shell
#

I am writing this for "communication"

primal shell
#

it has parent and this child

broken crown
#

How do I set the parent of another GameObject?

primal shell