0
Answered

Shark enemy AI - Float and attack on water

Sam Leitch 2 months ago in Game Creator updated by Marti (Lead Developer) 2 months ago 1

Hello,

On attack the shark moves into the air a little and dosn't come down.

I have a Shark AI that moves and patrols a section of water. When it sees the player is moves to it, follows it and attacks. 


Its attack moves the shark model up a fraction, and because i have the max fall speed set to 0 so it floats on the water it then says above the water.


Is there a way to limit the Y access movement or lock it so it cant move up. Or can i tag it and lock it to only move on a taged surface?


I have inspected the Melee clip i have for the attack and confirm that it just stays still and dosnt rise.


It dosnt have a rigidbody or a non trigger collider that would lift it coming in contact with the player. 

Anyway if anybody has any tips i would loveto hear them.

Sam

Unity version:
2019.4.1f1
Game Creator version:
1.1.9
+1
Answered

The Melee Clip has the option to modify each axis component individually using curves. It should be possible to make the shark go up, attack, and go down to its zone. To do so, however, I'd recommend disabling the gravity during the animation clip, as the two forces will try to fight each other.