#Flow's coding stuff
1 messages · Page 1 of 1 (latest)
good job for deciding to learn C#
good job for deciding to learn Unity
Okay, you don't need to be like that. I get what I said was stupid.
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
sorry, i interpreted what you were saying as you making fun of what I said.
I wasn't, I am just kind
It didn't work /:
I think it might be something like physics.onColliderEnter or MeshCollider.onEnter
This didn't work either ):
ofc it doesn't work
that's quite logical I think
you have just created random method
I figured it out, but I have a new problem
Unity does have methods that you can use
I never learned how to get properties from methods.
is it a question?
also this question doesn't make sense
this is method, just random method
it won't be executed from Unity
start writing OnCollision... and then you will see drop-down panel
you click "Enter" and it makes you this method
private void OnCollisionEnter(Collision collision)
{
}
without parameter it's just another method
I typed "OnCollisionEnter." but it didn't give me a list of stuff.
you need to type OnCollisionEnter when creating method
it doesn't exist in your context
Oh wait, like this?
transform.SetParent does not take method as parameter
yes
I have said you this already, it doesn't take void as an argument
I don't know visual scripting, but I think it's completely different, learn how C# works
hover SetParent method and see its parameters
I'm not trying to have it take void as an argument
click on method's name in window that appears when hovering it to look on its class
that's exactly what you are trying to do
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
you already have collider in OnCollisionEnter method
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
no
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
which one is correct?
Upper one; collider directly to transform
Visual Scripting does the conversion in the background in that circumstance
it seems to have much less abilities
It does, but QOL features like this are cool
don't know, just don't like working with smth with small amount of abilities
even though I work with C#
you have error there, that's not because of your script
there is written everything in your error
it appers when colliding, yes
Hey wait, if there's no target and parent arguments, how would I make this work?
read what I have written before
I am writing this for "communication"
SetParent just sets parent
it has parent and this child
How do I set the parent of another GameObject?
that's the way