In some of my games, the particle acts as the bullet.
So instead of OnCollisionEnter, OnParticleCollision is the hit detection.
I want to give damage to DamageZone from Script or ORKEvent when it is hit by OnParticleCollision.
I don't know how to do it.
I found a node called [Use Damage Zone], but I don't understand what it means even after looking at the help text.
Do I run Calculate when I have a Success in [Use Damage Zone]?
I would like to know a simple way to do this, either using [Use Damage Zone] or a direct Script.
Please tell me how to damage the CustomScript in ↓.
???? I don't understand the part of ?
void OnParticleCollision(GameObject other)
{
//ToDo Damage to ORK
var damageZone = other.GetComponent<ORKFramework.Behaviours.DamageZone>();
if (damageZone != null)
{
damageZone.Damage(BaseAction???); // How to Define BaseAction
}
}
So, if you have the damage dealer on the game object with your particle system it should get notified of particles hitting other game objects.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
The reason is that some of the assets I bought have RayCast hit detection.
In that case, I want to call AddDamage within if(raycast) and use it there as well.
Also, the method of DamageDealer in Tutorial's Realtime Battle is not easy to use because you can't perform any other actions while waiting in the Wait node, and you need to manage the Wait end time, which is difficult to use.
■iOS
https://itunes.apple.com/us/app/id679133055
■Android
https://play.google.com/store/apps/details?id=com.WabiPlant.SAMURAI100SlashLite
New ORK Battle Game
■iOS
https://itunes.apple.com/jp/app/id1403510381
■Android
https://play.google.com/store/apps/details?id=com.Company.AgentFight
You can't really cause damage to a damage zone without a damage dealer that was activated by an action. However, you can either change status values, effects, etc. directly on a combatant or use an ability to calculate those things.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
(It is a series like this one
(https://assetstore.unity.com/packages/vfx/particles/spells/realistic-effects-pack-4-85675?locale=ja-JP)
Because the asset is updated, you cannot customize this script.
(The original will be overwritten every time the asset is upgraded.)
So you can't use the RayCastObject step.
(The RayCast system has the script on this asset side)
Using projectile collision detection:
Just add follow script on prefab of effect.
void Start () {
var physicsMotion = GetComponentInChildren<RFX4_PhysicsMotion>(true);
if (physicsMotion != null) physicsMotion.CollisionEnter += CollisionEnter;
var raycastCollision = GetComponentInChildren<RFX4_RaycastCollision>(true);
if(raycastCollision != null) raycastCollision.CollisionEnter += CollisionEnter;
}
private void CollisionEnter(object sender, RFX4_PhysicsMotion.RFX4_CollisionInfo e)
{
Debug.Log(e.HitPoint); //a collision coordinates in world space
Debug.Log(e.HitGameObject.name); //a collided gameobject
Debug.Log(e.HitCollider.name); //a collided collider :)
}
So, I need to tell DamageZone to CollisitonEnter from my script.
What should I do in that case?
private void CollisionEnter(object sender, RFX4_PhysicsMotion.RFX4_CollisionInfo e)
{
//ToDo Damage to ORK
var damageZone = e.HitGameObject.GetComponent<ORKFramework.Behaviours.DamageZone>();
if (damageZone != null)
{
damageZone.Damage(BaseAction???); // How to Define BaseAction
}
}
■iOS
https://itunes.apple.com/us/app/id679133055
■Android
https://play.google.com/store/apps/details?id=com.WabiPlant.SAMURAI100SlashLite
New ORK Battle Game
■iOS
https://itunes.apple.com/jp/app/id1403510381
■Android
https://play.google.com/store/apps/details?id=com.Company.AgentFight
There is a DamageDealerType called "Custom".
But this has no Help text.
How do I use this?
■iOS
https://itunes.apple.com/us/app/id679133055
■Android
https://play.google.com/store/apps/details?id=com.WabiPlant.SAMURAI100SlashLite
New ORK Battle Game
■iOS
https://itunes.apple.com/jp/app/id1403510381
■Android
https://play.google.com/store/apps/details?id=com.Company.AgentFight
CustomDamage(GameObject gameObject, Vector3 position, Quaternion rotation)
It takes the gameObject that should receive damage, the position and rotation that was hit (e.g. for particle effects spawning).
Has the script on your particles any reference to what originally spawned them, e.g. where the damage dealer would be attached to?
You can create a BaseAction for the damage calculation, but you'd already need to know which ability or item is used, and if you know that (e.g. stored somewhere on the script) you could already store access to the actual damage dealer.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
It looks a little difficult. I will figure out another way.
I decided to stop using RayCast and add my own box collider and damage zone to the particle laser weapon, different from the Asset, and use AutoDamageDealer to make the decision.
Another serious problem question.
In the Real-time Battle tutorial, there is a "Wait" step to wait for Ability A to make a detection to hit DamageDealer.
During this WaitStep, Ability B cannot be performed.
This makes the game less fun as an action RPG.
For example, if you shoot a fireball, you can't shoot a blizzard ball until the fire disappears.
What settings do I need to change to avoid this?
I've checked all the control map settings, real-time battle settings, ability settings, Input settings, BattleEvent settings, Wait Step options, etc., but I can't find any settings that would allow me to avoid this.
■iOS
https://itunes.apple.com/us/app/id679133055
■Android
https://play.google.com/store/apps/details?id=com.WabiPlant.SAMURAI100SlashLite
New ORK Battle Game
■iOS
https://itunes.apple.com/jp/app/id1403510381
■Android
https://play.google.com/store/apps/details?id=com.Company.AgentFight
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!