User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: How to get an enemy to face its direction of movement.

  1. #1
    Clicker Multimedia Fusion 2
    Narfafian's Avatar
    Join Date
    Jul 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to get an enemy to face its direction of movement.

    Im making a top down zombie shooter, and i have it set up so when the zombies are close to the player they follow the player. While following the player i use the expression "ATan2(Y( "zombie" )-Y( "Player" ), X( "Player" )-X( "zombie" ))" this causes the zombies to face and follow the player. Im now trying to figure out how to set the zombies to face their direction of movement. (Im using "Ball" movement on them). How can i make it so that the zombies face the direction they are moving so that it appears that they are walking forward.

    (forgive me if i have accidentally posted this in the wrong place)

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Eliyahu's Avatar
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In the Zombie's properties, go to the tab with the red play button, "Runtime Options." Enable automatic rotations.
    It sounds like this is what you want.

  3. #3
    Clicker Multimedia Fusion 2
    Narfafian's Avatar
    Join Date
    Jul 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just tried that, zombies still "walk" sideways an backwards.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Eliyahu's Avatar
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you are setting angle with ATan2, that's going to override the automatic rotations.

  5. #5
    Clicker Multimedia Fusion 2
    Narfafian's Avatar
    Join Date
    Jul 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    im only setting th angle with ATan2 for the zombies that are following the player. (The zombies with alterable value A equaling 1).

    The zombies that are set with ATan2 function the way that i want them to.

  6. #6
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure if Eliyahu knows this, but automatic rotations only work with the built-in movements.
    Working as fast as I can on Fusion 3

  7. #7
    Clicker Multimedia Fusion 2
    Narfafian's Avatar
    Join Date
    Jul 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Assuming he doesn't, is there another way to do it that doesn't involve automatic rotations?

    Actually since im using the ball movement i was able to get automatic rotations to work, but the anti aliasing is really bad, and the turning was a bit choppy. Is there a way to do it where the turning is less choppy. When i was using ATan2 it was fine.

  8. #8
    Clicker Fusion 2.5iOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    SolarB's Avatar
    Join Date
    Feb 2012
    Location
    Melbourne
    Posts
    905
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    set angle to direction*11.25

  9. #9
    Clicker Multimedia Fusion 2
    Narfafian's Avatar
    Join Date
    Jul 2012
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That worked a little better, what i did was set the angle of zombies with Alterable value A = 0 to dir("zombie")*11.25 and set the angle of zombies with Alterable value A = 1 to "ATan2(Y( "zombie" )-Y( "Player" ), X( "Player" )-X( "zombie" ))". This way the zombies that are turning a lot have smooth turning, and the zombies that are just moving forward and turning when they reach an edge have the choppier turning.

    Thanks guys!

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Eliyahu's Avatar
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by LB View Post
    I'm not sure if Eliyahu knows this, but automatic rotations only work with the built-in movements.
    I've been using MMF2 for years; I know this.

    Narfafian specified that he was using Bouncing Ball movement, and last I checked, that was a built-in movement.

    I'm still confused why you're using trig and setting angle if you're using Bouncing Ball. What exactly is your movement? Is there any custom aspect to it?

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Enemy Movement
    By jbrown2177 in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 15th August 2012, 10:07 PM
  2. Spaceship movement left and right trought bouncing ball movement instead 8 direction?
    By daryuss in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 22nd May 2012, 10:33 PM
  3. Vector bullet fired from 360...how to set angle to face direction?
    By Blacstar in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 8th March 2012, 06:01 PM
  4. Advice in changing enemy direction
    By Warmachine in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 16th September 2011, 11:34 PM
  5. Enemy Movement
    By Pixzel in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 6th March 2011, 07:24 PM

Tags for this Thread

Posting Permissions

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