edited June 2015 in Makinom Support
1: for my first question im trying to figure out best way to tell an ai that they received damage an that they should then turn to go after what ever attacked them. so say even if the player is out of range of a ai the ai would still go after the player weather or not they are with in distance. now i got a working damage system an it works fine an plenty of ai but there all based off distance checks. but this time i have to do ti with damage ...

2: need an idea of which nodes would be best for doing something like recoil to move the position and rotation of an object around in some what of a smooth matter.
Post edited by wtyson on
new website can be found here http://www.fore-loregames.com

Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

or check out the face book page here https://www.facebook.com/ForeLoreGames
  • 1) You could set an object bool variable to notify your AI (or movement) script of the damage and store the position of the game object that caused the damage in a object Vector3 variable.
    You'd only have to check for the bool in the move/AI schematic and go to that position.

    2) That's usually handled by Rigidbody nodes - e.g. Rigidbody Add Force and Rigidbody Add Torque, but you'll need to experiment to get good results :)
    Or, if it's only for animation (e.g. weapon fire recoil), that would be part of a firing animation.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • on number 2 so if i use rigidbody add force is there a way to stop it after you add the force cause i keep floating int he directions i apply the force to an cant seem to reset it back to its original position
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • and on number 1 im a little confused at how to pull what damaged the target. in unreal engine theres a way to check a instigator of damage but there damage system is integrated into the system. should i just store the players position in a object variable that can be checked when the bool is triggered something like in a scene game manager have a object variable machine set up to house the variables. then do something like a tick as well that continuously gets the players position and then if they are damaged set a local bool on the enemy's damaged machine that will then have a check in the movement script ? day off so just kinda getting a 2nd opinion :P to make sure my train of thought is correct
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • ok on number 2 i did some test with just changing the position but seems it ignores trying to reset a position back to 0,0,0 any way to get around this?
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • 1) You can always access the Player game object directly in any object selection (e.g. using a Game Object type Vector3 value, you can directly use the player's position), so if the source of a damage (that should be moved to) is always the player, you don't need to store it.

    There's also no need for an object variable kind of scene manager - you can just use global variables for that (unless you have any special use case in mind and don't want that information stored in global variables).

    2) To stop a rigidbody, you need to set the velocity to 0 on all axes, e.g. using the Rigidbody Change Velocity node.
    Usually, the rigidbody will slow down and stop over time due to physics (e.g. friction on a surface, or gravitiy pulling the object back down), but if that's not happening in your game, just set the velocity to 0.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • yeah main reason for not using global vars is cause i need to implement networking later on. an using globals dont work well in networking since you cant synch them to the player or players when dealing with clients. unless you plan to make a system that will take this into account.
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • Once I come to looking into the networking stuff, global variables might be shared (at least optionally). But it's still some time until I get to that :)
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • ok then ill work it the easy way for now an hope for the optional thing later on ^^!
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • so i back to working on my recoil system here an im still a little confused at how rigid bodys should work for this seems that even with all the stops on the rigidbody itll still ignore it every so often an my arms will still keep moving so an i tried doing change position an that just makes it look really unnatural. But dont get the slowly moving away arms ... im wondering if i should be applying a excess amount of force to make it jerky or is there some kind of trick to it?
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • after looking into this more seems most people use the transform localEulerAngles. so goign to go through all the nodes to see if i can find the best one for this
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
  • ok this is solved using the transform an setting a local vector 3 with random settings works good
    new website can be found here http://www.fore-loregames.com

    Follow the game Development on Twitter https://twitter.com/Fore_Lore_Games

    or check out the face book page here https://www.facebook.com/ForeLoreGames
Sign In or Register to comment.