Today we are presenting two static creatures and one trap. Creatures are Flower and Spider and trap is flame throwing gargoyle. First, here is video with all three elements in action:
And here are additional details:
Flower is static creature. It just sits on spot and spits missiles horizontally. It can be configured to spit in regular intervals or spit only if it detects player. On image below, you can see part of its long detector:
Spider is more interesting. It is going slowly up and running down fast. As it may look simply, it consists of some nice features. First, spider is what we call “path follower”. Such creatures have predefined path and follow it. Spider has only two nodes, as can be seen on image below. Path between two nodes can be traveled in different ways – most simply linearly, but also with sine or parabolic easing. Path can have any number of nodes and follower can follow it in loop or ping-pong way. In each node follower can take stop for defined time and path script fires events on arriving into node and on leaving node.
Second trick was, how to make spider’s web. It is sprite rendered with SpriteRenderer with Draw Mode set to Tiled. Problem was, that web was unwinding from its anchor in ceiling instead of spider. See animation below to see what I mean. Left web is unwinding from top, but right one is fixed and just extending in the bottom – this is what we want for spider:
We achieved it with following SpriteRenderer settings:
Spider web height is negative and to let it point downwards, we also had to set scale Y to -1.