# Thread: Konidias 8 direction fast loop collision example - fixing diagonal speed

1. ## Konidias 8 direction fast loop collision example - fixing diagonal speed

This example works perfect but the diagonal speed is faster than horizontal or vertical and I'm trying to overhaul this to get it to work. The speed difference isn't huge but I can notice it. I tried doing my own custom movement a long time ago using Sin and Cos expressions but I ultimately scrapped it because of various problems I was encountering.

I reproduced the example on my own which might be easier to quickly parse since it's barebones (see attached)

2. If you dont do anything with the vertical and horizontal speed when you press for 2 directions, it will move too fast. What first comes to mind is that you must divide the movement speed by 2, but Im not sure if this is correct.. Could be you must multiply it by cos(45).
Either way, you must make some new events on the top (or at least somewhere before the events you have now). Since you are using the same alterable value for both directions, I guess you can make an Always event to set the movement speed to original speed (save this in another alterable value). Then make another event to check for up+right OR up+left OR down+right OR down+left. If true, set movement speed to movement speed * X (try X as 0,5 or cos(45) and see which makes the most sense). Geometry is not my strongest skill, but I know from before that leaving this untouched will make a wrong output

Hope you get what I try to say :P

Edit:

Working with decimals is a bit tricky in Fusion 2.5, but here is a demo to demonstrate what I mean, using a little tweak in how the movement works. The red object does not have any changes to movement speed, and the green object have applied what I mentioned above.
DiagonalSpeed.mfa

3. Here are two ways of doing it, with fastloops and with physics.
8Directions-Fastloops-and-physics.mfa

4. Thanks guys! This is a life saver. I was banging my head on my keyboard trying to solve this on my own lol. Marius, I tried adding fastloop collision to your example but couldn't get it working properly (my fault). BartekB, your fastloop example is exactly what I needed it to do.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•