49) I noticed that if I choose Use Group on a spawner and choose a group with some enemies and then set Spawn Settings to Quantity: 1 and Random Rotation True, I always get the first of the enemies of the group, so it doesn't Randomly choose 1 of the group. Both Autostart and Trigger Enter.
Also the additional battle gains in the combatants group doesn't seem to always work
50) I m trying to have the enemies shooting fireballs on me, is there a way that a "Rotate To (Target)" work on unstable terrain? What I mean is that if I m in a mountain like terrain and I have a height difference with the enemy, the enemy will just rotate to me but the fireball will just hit the ground below. I know that I can have move To Target node and have the fireball go to the Player, but I'm trying to make a more active fights so the player have a chance to avoid the fireballs of the enemy. So a node that would rotate the enemies Center to the player Center before spawn the prefab that will move to direction would do that. Hope you understood what I'm trying to achieve :)
49) Random rotation is refering to the rotation of the spawned combatant's game object :) The spawner will always spawn the leader of the group, which is the first added combatant of the group.
50) Well, you can just shoot the fireball into the player's direction instead of just forward.
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!
50) I didn't know that existed! I tested it tho and the fireball goes into a completely different direction. Player's position i 250/1/250 and the fireball goes to something like 5000/210/2500. played with different settings in the node but with no luck
You first have to calculate the direction, just using the player's position will result in a wrong behaviour :)
You can calculate a direction by subtracting the game object's position from the target's position, i.e. in code: Vector3 direction = target.position - origin.position;
You can do this in the event system by using 2 Transform To Variable nodes: 1) Store the target's position into a local variable (operator Set) 2) Subtract the user's (or fireball's) position from that local variable (operator Sub) The local variable now contains the direction which you can use in your movement node.
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!
Game variable, since you want to use the direction you previously calculated :)
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!
Nothing. E.g. using a Move Into Direction node, you'd move your fireball actor/prefab using the game variable as direction.
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!
So I did this, and the prefab spawns in the correct position now (in front of the enemy) but doesn't move towards the target with the speed I have, it seems like it stays there in front and move with like 1 speed, or not at all.
Played a bit with the Local Space, Ignore Height, Face direction etc. but with no luck. Also I had 0.1 wait between it's step
back to 49) How would you approach when you want to randomly spawn a combatant from a group when a spawner is enabled (autostart). I can't seem to find a proper way to do it. What I'm trying to achieve is have random boss spawn at the Dungeon.
The 2nd Transform To Variable should also use Value for the variable key, since you're defining the key :) Also, I'd recommend using the spawned fireball's prefab instead of the user if it's not spawned at the same position. It only makes a small difference in direction, but it's still a difference.
49) Set up multiple groups with different leaders and randomly spawn one of the groups. Also - if it should just be a single combatant (boss), you can also just spawn individual combatants instead of using groups.
Post edited by gamingislove on
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!
Hm .. strange. The prefab itself is already spawned at that point, I hope :D Try storing the position in a global variable and check out which value is stored in it. You can see global variables in the inspector by selecting the _ORK game object in the scene.
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!
edit: it seems that it didn't set the Target's position (ignored it), set it to All enemies and use center seems to work. getting this var result now, but still the fireball travels the different way, I ll figure it out now I guess
edit2: well player's Z - Enemy Z seems like a correct result, so ends up - sometimes which I guess causes the fireball to go the other way. Do I miss something?
edit3: disabling the local space in Move Node seems to fixed it.
"26) Could the enemy drop the loot before the death event finishes? tried calculate before the wait time but it didnt work. trying to have a faster pace real time combat, with enemies stay for some seconds in the ground, but the loot to be dropped faster."
your answer was that you'll look into that, and I would like to know if you came up with something :) because now I have to despawn the enemies asap when they die so I get the drops :)
Ah, yeah ... sorry, I didn't notice the Local Space flag in your screenshot. That'll most certainly change the direction you're going, since the direction you've calculated was in global space :)
26) I don't really have a solution yet. I'll look into adding a node to handle loot/exp rewards of a combatant in events, so that this isn't done after the death events finished.
Alternatively, you can disable destroying the combatant's prefab on death (see the combatant's death settings) and destroy the game object after time (without waiting) in the death event. That way the event ends earlier and the combatant's game object remains for some time.
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!
Also the additional battle gains in the combatants group doesn't seem to always work
50) I m trying to have the enemies shooting fireballs on me, is there a way that a "Rotate To (Target)" work on unstable terrain? What I mean is that if I m in a mountain like terrain and I have a height difference with the enemy, the enemy will just rotate to me but the fireball will just hit the ground below. I know that I can have move To Target node and have the fireball go to the Player, but I'm trying to make a more active fights so the player have a chance to avoid the fireballs of the enemy. So a node that would rotate the enemies Center to the player Center before spawn the prefab that will move to direction would do that. Hope you understood what I'm trying to achieve :)
49) Random rotation is refering to the rotation of the spawned combatant's game object :)
The spawner will always spawn the leader of the group, which is the first added combatant of the group.
50) Well, you can just shoot the fireball into the player's direction instead of just forward.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
You can calculate a direction by subtracting the game object's position from the target's position, i.e. in code:
Vector3 direction = target.position - origin.position;
You can do this in the event system by using 2 Transform To Variable nodes:
1) Store the target's position into a local variable (operator Set)
2) Subtract the user's (or fireball's) position from that local variable (operator Sub)
The local variable now contains the direction which you can use in your movement node.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
https://imgur.com/zJwlIiL
https://imgur.com/9mAuD9x
https://imgur.com/4ZAXePY
So I did this, and the prefab spawns in the correct position now (in front of the enemy) but doesn't move towards the target with the speed I have, it seems like it stays there in front and move with like 1 speed, or not at all.
Played a bit with the Local Space, Ignore Height, Face direction etc. but with no luck. Also I had 0.1 wait between it's step
back to 49) How would you approach when you want to randomly spawn a combatant from a group when a spawner is enabled (autostart). I can't seem to find a proper way to do it. What I'm trying to achieve is have random boss spawn at the Dungeon.
Also, I'd recommend using the spawned fireball's prefab instead of the user if it's not spawned at the same position. It only makes a small difference in direction, but it's still a difference.
49) Set up multiple groups with different leaders and randomly spawn one of the groups.
Also - if it should just be a single combatant (boss), you can also just spawn individual combatants instead of using groups.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Try storing the position in a global variable and check out which value is stored in it. You can see global variables in the inspector by selecting the _ORK game object in the scene.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Prefab:
Global Var:
edit: it seems that it didn't set the Target's position (ignored it), set it to All enemies and use center seems to work. getting this var result now, but still the fireball travels the different way, I ll figure it out now I guess
edit2: well player's Z - Enemy Z seems like a correct result, so ends up - sometimes which I guess causes the fireball to go the other way. Do I miss something?
edit3: disabling the local space in Move Node seems to fixed it.
"26) Could the enemy drop the loot before the death event finishes? tried calculate before the wait time but it didnt work. trying to have a faster pace real time combat, with enemies stay for some seconds in the ground, but the loot to be dropped faster."
your answer was that you'll look into that, and I would like to know if you came up with something :) because now I have to despawn the enemies asap when they die so I get the drops :)
26) I don't really have a solution yet. I'll look into adding a node to handle loot/exp rewards of a combatant in events, so that this isn't done after the death events finished.
Alternatively, you can disable destroying the combatant's prefab on death (see the combatant's death settings) and destroy the game object after time (without waiting) in the death event. That way the event ends earlier and the combatant's game object remains for some time.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!