#How do I make an if statement read the console?

1 messages · Page 1 of 1 (latest)

gleaming igloo
#
if (The console says "explosion")
{
  Debug.Log("Hello")
}
faint rune
#

I'll fully answer this here

gleaming igloo
#

Thank you

faint rune
#

So essentially

Application.logMessageRecieved += (msg,_,_) => {
     if (msg.contains("explosion") {
          Debug.Log("Hello");
     }
};
gleaming igloo
#

Error CS0117 'Application' does not contain a definition for 'logMessageRecieved'

#

Thats the only error

faint rune
#

I misspelled received

gleaming igloo
#

I am afraid of the second error

faint rune
#

Alright, replace both underscores with a & b respectively

gleaming igloo
#

Ok I fixed the first error

#

I accidently type += twice

#

Second error fixed too

#

new error

faint rune
#

What now?

gleaming igloo
faint rune
#

Contains needs to be capitalized

gleaming igloo
#

ok no more errors

#

lets see if it works now

#

Thank you so much

#

It works now