the problem is i want to use one object.
I have seen other peoples way of trying to do it but they kinda slide around.
Entropy:“it’s a pathfinding object that walks up and down left to right no diagonals and is animated with an idle state
I’m pretty sure it’s impossible to do with one object
The cows also have to pathfind around each other
But for that you would need object IDs or using the linking system
Having it two objects does simplify the cow’s path finding around each other and blocking each other
It just seemed like a for one animal because I’m going to be adding a few of them”
“Leo Red: Does your pathfinding object have “rotate the object when turning” truned on?”
Entropy:“If you allow rotation in the behavior it will mess up all the animations because your whole object is rotating
That would rotate the cow in its spot
The cows walk up and down left to right”
Leo Red: “@Entropy Hey, I found a way using only one object. It is not the best way. But, works”
Entropy: “That would be two scene variables per animal
Does she slide around in animation I’ve seen other examples and that’s what happens
You might not be able to tell with that type of top-down view art
Because that’s in an isometric perspective or tilted angle art”
I’m sorry i should of been more clear on my questions i was nervous.
at the end of the formula you divide by 90 not 45, because you only have 4 directions.
the conditions are the same, in actions replace the 8+ with 4+
and the /45 with /90 and ure good to go.
this formula, as you can see, does not work with the angles of the object, only the pathfinding notes. so it works with rotation disabled.
E: this is, assuming your animation number 0 is idle:
I’m sorry i was really tired my brain was not working i added the arc tangent comparing.
But unsure of the order of animations for walk and idle i tried to make directions work at the least but that didn’t fully work I know it says +1 and +5 for 0 < and >0
but my number of animations are not quite like it seems like there would be one animation for idle state
that but my brain is still not working iv been working on different projects and helping.
the problem is the order of you animations.
it goes like this.
anim 0 = right
anim 1 = down
anim 2 = left
anim 3 = up
Clockwise Animations, because Math
keep that order for all animations.
then you have not 1 idle anim, but 4, so you need +4 instead of +1
means 4+round( and 8+round(
as for your idle animations, you could make a subevent with variables to determine the direction and set the animation with that variable.
heres what i do:
I enable rotation of the pathfinders. so that i can work with the angles, instead of needing variables. saves some memory. and i need the angles for more then just animations anyway. changing the animations is actually very easy and fast.
Inside Piskel, Hold shift and click on rotate till your frames look to the right.
i think the problems are minor and easy to fix.
you will face other problems with other engines too.
I reccomend not giving up so easely.
have a look at the pathfinding behavior of the cows.
what numbers do you use for ther grid? (cell height/with?)
i see the problem might be the timer. you need to guarantee first, that they only move straight lines, aka stay in ther 64x64 grid. means they should only start to change the directions, once they reached ther destination.
I already had a problem with the lighting layer not hiding the ambient light color and not being able to change the ambient light color in events or js i had to use the dark night effect and no dynamic lights im done fighting the engine with this project
Hey, I found a example from the pathfinding wiki. I don’t know how it is working. Maybe, because it might have been made on GD4. It might help. I work without a problem.GDevelop 5