Categories
Uncategorised

My Project Design_v1.1.2

I can do it….

Some Logic of my character’s Movement And Animation

Overview

  1. The Red character Guardian Spirit move to 1 and stop in front of the obstacle trunk.
  2. Players move the trunk away
  3. Red character keeps moving forward
  4. The route is from A to B

Prefab

The Guardian Spirit prefab contains 2 parts: Human ( sitting Idle) and Treasure Chest.
I assigned an animator on human.
It controls the character’s animation of sitting idle.
It is called GardianSpirits

Animator

I also assigned another animator on red character prefab. This animator is used to control position of the whole prefab.

AnimationGS_test1 is an animation controls Guardian Spirit to move from A to 1.
AnimationGS_test1_s2 controls Guardian Spirit to move from 1 to B.
I added a trigger between AnimationGS_test1 and AnimationGS_test1_s2, which controls whether to play AnimationGS_test1_s2.

To meet the condition that makes AnimationGS_test1_s2 available, I added some box colliders to activate this trigger.

My Logic

Using Box Collider

Create 4 box colliders surround the trunk, also there is box collider on the trunk.

Players need to select and move the trunk,
Once box collider of the trunk collides with these 4 box colliders around it, the Boolean isRemoved set to true.
If bool isRemoved set to true, trigger on Guardian Spirit animator(AniGS_s2) will be activated, animation clip moving forward to B would play.

My Scripts

TrunkController (trunk)

GSAnimation (Guardian Spirit)

Leave a Reply

Your email address will not be published. Required fields are marked *