SuehtamSatierf's Recent Forum Activity

  • Objective:

    The objective is to have enemy spawners scattered around the map to spawn new enemies every X seconds (a feature already implemented). These enemies are 3D objects with a sprite containing animations being projected onto the 3D object's bottom face. The objective is to have every new enemy spawned have the correct animations based on their angle. Example:

    If the enemy's angle is 45 degrees, the animation for that instance will be "Southwest_Idle", whereas if its angle is 0 degrees, the animation will be "East_Idle".

    The angle is determined by the Enemy's position in relation to the player.

    Current approach:

    For every tick, I set an instance variable called "selfAngle" in the enemy 3D object to angle(Self.X , Self.Y, Player.X, Player.Y). Then, I compare the value in that instance variable to check if the number stored in there is greater or equal to an angle and less than another (e.g. >= 0 and < 30). If that is true, the program set the correct animation accordingly.

    In terms of having the correct animation according to the angles, this is working.

    Problem:

    Since all the 3D objects being spawned reference the same single instance of the animation sprite, all the enemy instances face the same direction.

    A possible solution that I thought of was to spawn a new instance of the sprite containing the animations and project that specific instance onto the new corresponding 3D object that was also generated. However, I have no idea how to do that and need help.

    What could I do to solve this problem?

    Link for the C3 Project:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
SuehtamSatierf's avatar

SuehtamSatierf

Member since 17 Dec, 2022

None one is following SuehtamSatierf yet!

Trophy Case

  • 2-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

5/44
How to earn trophies