#pastie is hard to read without proper

1 messages · Page 1 of 1 (latest)

crisp oyster
#

how do i format it?

thorny moat
#

just select the language when you paste it . . .

crisp oyster
#

sec

thorny moat
#

and what is the actual error message/pic you get from unity . . .

crisp oyster
#

ill give you a screen

#

hm it's hard for me to capture it. on line 51 im trying to access the custom script that is attached to the tile at "currentTile" which is a TileBase Tile (so basically, a type of tile "grass" "water" etc. which exist in the palette. i'm sorry if i'm not explaining it well. but the point is i'm able to grab variables like .Sprite or .color, but I can't get the ones on my custom script

#

there's no error in unity

thorny moat
#

hard, how?

crisp oyster
#

because i was trying to take a screenshot of the dropdown window in VS lacking the variables I am looking for lol. so i just used words

thorny moat
#

anyhoo, you cast currentTile to a Tile, so it only has (and can access) members from Tile . . .

crisp oyster
#

oh, one sec

thorny moat
#

it doesn't know anything about CustomTile bc it's not that type . . .

crisp oyster
#

should I be using CustomTile everywhere I'm using Tile?

#

in the script?

thorny moat
#

CustomTile, the child, derives from Tile, the parent . . .

#

use CustomTile where you need to access that type's members: public fields, methods, etc. . . .

crisp oyster
#

I think I understand but 1 sec

#

bingo that worked

#

!!!!

#

thank you very much

#

I think the other person probably mentioned it but I forgot 😐

#

so much to learn. time to add casting to the list. ok thanks again

thorny moat
#

np . . .

crisp oyster
#

hm, actually it is giving me another issue that i don't quite understand...

#

never mind i think i fixed it

crisp oyster