#how can i do this?

1 messages · Page 1 of 1 (latest)

wind berry
#

Take a look at this example

storm pebble
#

okey, what happend at start?

wind berry
#

so if you know where you are in the world, you can check the array to see what's there

storm pebble
#

hmmm okey

#

but i this i have different map creator

wind berry
#

if you're learning specifically about colliders then you can ignore this and keep on as you were

storm pebble
wind berry
#

Is this your code?

storm pebble
#

yes

#

this generate a map by tiles

#

I can change the comments for english to be easier to translate this code

wind berry
#

no worries, it makes sense

#

when generating your map you can just construct the array too

storm pebble
#

how?

wind berry
#

you can create the array variable without a size,
WorldTiles[,] myMap;
myMap = new WorldTiles[rows, columns];

#

and init the size at runtime

#

then when you make your city

#

myMap[randomX, randomY] = WorldTiles.CITY;

storm pebble
#

i think this is a little too hard for me

wind berry
#

OK! good luck with your triggers. Arrays are great! I recommend you take a look some time.

storm pebble
#

firstly i think i should study how to make this stupid console log ;-;

wind berry
#

what's the problem with the log?

storm pebble
#

when my hero jump to tile with city the log doesnt sent

wind berry
#

show me the scene? the transform for the two objects you want to collide?

storm pebble
#

this?

wind berry
#

this looks like the game view

#

show me the scene view?

storm pebble
#

u mean this?

wind berry
#

yes good, now can you show me the inspector for this game object when it is selected? (the knight)

storm pebble
wind berry
#

ok and the town?

storm pebble
#

its alredy work 😄

wind berry
#

ok great, what was the problem?

storm pebble
#

i shoulded write the code to city and when the city touch hero its send massage

wind berry
#

ok! cool

#

good luck!