#OnTriggerEnter Ladder

1 messages · Page 1 of 1 (latest)

distant void
#

.

wheat smelt
#

,

wild summit
#

There's a whole bunch wrong with your code. It doesnt recognise that private, which means earlier you forgot to end a function with }, or did something else the C# compiler doesnt understand.

There's a . missing between other and gameObject, you want to get the gameObject property of other, and the syntax for that is other.gameObject.

wheat smelt
#

gameObject is a p[roperty?

wild summit
#

Or a field, i dont know which one unity decided to make it.

I guess i should have called it a variable.

wheat smelt
#

i mean

#

there is a attribute names gameObject?

#

property is the right word

distant void
#

no

wheat smelt
#

hmmmmm

#

isnt that just the name of the object tho

wild summit
#

Nope

distant void
#

the script is inside a private void FixedUpdate(), and this one is, obviously, inside a public class CharacterController2D : MonoBehaviour
{

wild summit
#

If you want you can post a bit more code.

But in general, you should have your methods separate. So you have one FixedUpdate method, and then a OnTriggerEnter.