Okay Really stumped on this one
eemachala
Member Posts: 21
Thought it was simple but cant figure this out and got some advanced rules on this npc's... Taken from animation left and right tutorial. Self.motion.linear velocity x < 0 Self.motion.linear velocity x > 0 used this and ruleset to have animation play ... works nice but just for left and right... When i try to throw in the Self.motion.linear velocity y < 0 & Self.motion.linear velocity y > 0 .. the character animations flicker between x and y directions obviously the tutorial works left and right, but how could i fix this, there is a deadzone where both x and y rules are active. think something with angles but not sure anymore tried so many things...
Fyi i have 4 animations for movement in 4 directions up down left right .
Fyi i have 4 animations for movement in 4 directions up down left right .
Comments
Without knowing more about when / how your NPC starts and stops movement in various directions, that's all I can suggest - maybe give us some more details / context if this doesn't work?
So when I set him off in a move direction he walks fine in all 4 directions... when i engage him him by breaking range limit... he follows does all his bits facing correct direction chasing but that it... just faces the direction no animations while moving... im using this to get my distance from player this is constraint to npc magnitude(abs( self.Position.X - game.PLayerX ),abs( self.Position.Y - game.PlayerY ))
Besides When this is called "Self.motion.linear.velocity.x < 0" AND "Self.motion.linear.velocity.y=0" then you play your "move left" animation;" the only other rule checked is a boolean to check if npc is in combat cause combat if used at very close range switches to attack animations..
Im really stumped.... is it to do with the way im following my player? got the chase code from how to section...
been browsing forums looking for the answer just cant find it
used for example self.NPCangle > 135 and self.NPCangle <215. and left works great following suit with the rest... but when i get to going right i had to use the left over angle comes to for me <30 and >315... and no animation.........
if i put just one angle 30 or 315 degrees it works just leaves me with a small deadzone where actor will drag instead of animation because has no rule .....
I think this is because angle looks like this 30---1,0,360---315, think the zero is messing with something
self.NPCangle > 315
self.motion.Linear Velocity.Y NotEqual to 0
and another rule with not equal 0 and < 30
Thank god was about to change it to a self.NPCangle to an integer and use angle 180 through -180
Well on to my next task