|
Post by Invector on Jan 17, 2017 15:03:28 GMT
|
|
|
Post by dreadlord on Jan 17, 2017 15:25:05 GMT
I recorded this after a quick integration last year and i get much better results now but it shows some kewl moments.
|
|
|
Post by Chronicman on Jan 17, 2017 16:00:35 GMT
That's bad ass.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 17, 2017 20:03:41 GMT
Awesome!!!!
|
|
|
Post by shadex on Jan 17, 2017 20:37:48 GMT
That looks awesome. Regretting getting exploder over DestroyIt now
|
|
|
Post by uberwiggett on Jan 18, 2017 1:05:17 GMT
I was toying with some destructable wall barriers just the other day! Looks like I'll grab this asset on my next order!
|
|
|
Post by dreadlord on Jan 22, 2017 18:00:32 GMT
Take a look into the destructible vases from the demo scene. Maybe you don't need this asset at all
|
|
red
New vMember
Posts: 18
|
Post by red on Feb 17, 2018 21:33:49 GMT
Official integration is a bit obsolete now. TakeDamage from vDestructibleCollider should be updated like this.
public void TakeDamage(vDamage damage, bool hitReaction = false) { if (ForceMultiplier <= 0f) // Default to 0.5f if for some reason ForceMultiplier hasn't been set. ForceMultiplier = 0.5f;
var point = damage.hitPosition; var relativePoint = transform.position; relativePoint.y = point.y; var forceForward = relativePoint - point;
if (rbody != null && destructible != null) { Debug.Log("[" + destructible.name + "] got hit for " + damage.damageValue+ " points of damage!"); destructible.ApplyDamage(damage.damageValue); rbody.AddForce(forceForward * (damage.damageValue * ForceMultiplier), ForceMode.Impulse); } }
|
|
|
Post by zangad on May 8, 2018 1:34:53 GMT
Hi all, DestroyIt programmer here. This thread just came to my attention when a customer on our forum had a question about updating the Invector TPS + DestroyIt integration script (mentioned above). dreadlord - I'm floored by the video you posted. What an awesome use of destruction in a game! shadex - You shouldn't regret buying Exploder. It will work great with DestroyIt. You can use Exploder to fracture things like rocks, vases, bottles - all the little things that you don't want to spend time fracturing yourself and that will look fine with procedural Voronoi cell fracturing. Then combine that with DestroyIt for the complex models that need to be destroyed more realistically - like vehicles, machinery, wooden chests or barrels, etc. Or items that you destroy a lot of and want the extra performance enhancements. red - Thanks for posting your update to our integration script. Here's the latest update to the vDestructibleCollider script that works with the latest versions of Third Person Controller and DestroyIt. vDestructibleCollider:using DestroyIt; using Invector.EventSystems; using Invector; using UnityEngine;
// This script provides an easy way to setup ModelShark Studio's Destructible objects // to work with Invector's Third Person Controller Melee Combat Template. // This script is automatically added to each collider when the vDestructible script is // on your Destructible object.
[RequireComponent(typeof(Collider))] public class vDestructibleCollider : MonoBehaviour, vIDamageReceiver { public float ForceMultiplier { get; set; } private Rigidbody rbody; private Destructible destructible;
void Awake() { destructible = GetComponentInParent<Destructible>(); if (destructible == null) destructible = GetComponent<Destructible>(); rbody = GetComponentInParent<Rigidbody>(); }
public void TakeDamage(vDamage damage) { if (ForceMultiplier <= 0f) // Default to 0.5f if for some reason ForceMultiplier hasn't been set. ForceMultiplier = 0.5f;
var point = damage.hitPosition; var relativePoint = transform.position; relativePoint.y = point.y; var forceForward = relativePoint - point;
if (destructible != null) { Debug.Log("[" + destructible.name + "] got hit for " + damage.damageValue + " points of damage!"); destructible.ApplyDamage(damage.damageValue);
if (rbody != null) rbody.AddForce(forceForward * (damage.damageValue * ForceMultiplier), ForceMode.Impulse); } } } For more details, see our forum post here: forum.unity.com/threads/released-destroyit-cinematic-destruction-system.251622/page-8#post-3477817Please let us know if you have questions about DestroyIt integration with Third Person Controller.
|
|
|
Post by xxscrumexx on Jul 31, 2018 6:14:32 GMT
Hey all, I recently updated to the most recent version of Invector TPC so that I could use their new AI system. When I completed the update from the asset store I started to get an error in my vDestructibleCollider.cs script. If I utilize the suggested fix I can destroy objects by running into them but not by shooting them. I have included an image showing the error and here is my code: using DestroyIt;
using Invector;
using Invector.EventSystems;
using UnityEngine;
// This script provides an easy way to setup ModelShark Studio's Destructible objects
// to work with Invector's Third Person Controller Melee Combat Template.
// This script is automatically added to each collider when the vDestructible script is
// on your Destructible object.
[RequireComponent(typeof(Collider))]
public class vDestructibleCollider : MonoBehaviour, vIDamageReceiver
{
public float ForceMultiplier { get; set; }
private Rigidbody rbody;
private Destructible destructible;
void Awake()
{
destructible = GetComponentInParent<Destructible>();
rbody = GetComponentInParent<Rigidbody>();
}
public void TakeDamage(vDamage damage, bool hitReaction = false)
{
if (ForceMultiplier <= 0f) // Default to 0.5f if for some reason ForceMultiplier hasn't been set.
ForceMultiplier = 0.5f;
var point = damage.hitPosition;
var relativePoint = transform.position;
relativePoint.y = point.y;
var forceForward = relativePoint - point;
if (rbody != null && destructible != null)
{
Debug.Log("[" + destructible.name + "] got hit for " + damage.damageValue + " points of damage!");
destructible.ApplyDamage(damage.damageValue);
rbody.AddForce(forceForward * (damage.damageValue * ForceMultiplier), ForceMode.Impulse);
}
}
}
As you can see in the image below the error is on the vIDamageReciever and it says that 'vIDamageReciever' is an ambiguous reference between 'Invector.EventSystems.vIDamageReciever' and 'Invector.vIDamageReciever'. I am at a bit of a loss on how to fix this issue and do not understand my Invector seems to change so many references with each update. It makes it a real pain to update without a mountain of issues to fix. Thank you for any help in advance.
|
|
|
Post by Invector on Jul 31, 2018 14:53:39 GMT
Try this:
using DestroyIt; using Invector; using Invector.vEventSystems; using UnityEngine;
// This script provides an easy way to setup ModelShark Studio's Destructible objects // to work with Invector's Third Person Controller Melee Combat Template.
// This script is automatically added to each collider when the vDestructible script is // on your Destructible object.
[RequireComponent(typeof(Collider))] public class vDestructibleCollider : MonoBehaviour, vIDamageReceiver { public float ForceMultiplier { get; set; }
public OnReceiveDamage onReceiveDamage { get { } }
private Rigidbody rbody; private Destructible destructible;
void Awake() { destructible = GetComponentInParent<Destructible>(); rbody = GetComponentInParent<Rigidbody>(); }
public void TakeDamage(vDamage damage) { if (ForceMultiplier <= 0f) // Default to 0.5f if for some reason ForceMultiplier hasn't been set. ForceMultiplier = 0.5f;
var point = damage.hitPosition; var relativePoint = transform.position; relativePoint.y = point.y; var forceForward = relativePoint - point;
if (rbody != null && destructible != null) { Debug.Log("[" + destructible.name + "] got hit for " + damage.damageValue + " points of damage!"); destructible.ApplyDamage(damage.damageValue); rbody.AddForce(forceForward * (damage.damageValue * ForceMultiplier), ForceMode.Impulse); } } }
|
|
|
Post by xxscrumexx on Aug 1, 2018 1:09:10 GMT
Try this: using DestroyIt; using Invector; using Invector.vEventSystems; using UnityEngine;
// This script provides an easy way to setup ModelShark Studio's Destructible objects // to work with Invector's Third Person Controller Melee Combat Template.
// This script is automatically added to each collider when the vDestructible script is // on your Destructible object.
[RequireComponent(typeof(Collider))] public class vDestructibleCollider : MonoBehaviour, vIDamageReceiver { public float ForceMultiplier { get; set; }
public OnReceiveDamage onReceiveDamage { get { } }
private Rigidbody rbody; private Destructible destructible;
void Awake() { destructible = GetComponentInParent<Destructible>(); rbody = GetComponentInParent<Rigidbody>(); }
public void TakeDamage(vDamage damage) { if (ForceMultiplier <= 0f) // Default to 0.5f if for some reason ForceMultiplier hasn't been set. ForceMultiplier = 0.5f;
var point = damage.hitPosition; var relativePoint = transform.position; relativePoint.y = point.y; var forceForward = relativePoint - point;
if (rbody != null && destructible != null) { Debug.Log("[" + destructible.name + "] got hit for " + damage.damageValue + " points of damage!"); destructible.ApplyDamage(damage.damageValue); rbody.AddForce(forceForward * (damage.damageValue * ForceMultiplier), ForceMode.Impulse); } } } Thank you for the reply. This fixed the original error but created a new one that states that not all code paths return a value on line 19.
|
|
|
Post by Yort_Draeb on Aug 4, 2018 19:53:29 GMT
Try this: using DestroyIt; using Invector; using Invector.vEventSystems; using UnityEngine;
// This script provides an easy way to setup ModelShark Studio's Destructible objects // to work with Invector's Third Person Controller Melee Combat Template.
// This script is automatically added to each collider when the vDestructible script is // on your Destructible object.
[RequireComponent(typeof(Collider))] public class vDestructibleCollider : MonoBehaviour, vIDamageReceiver { public float ForceMultiplier { get; set; }
public OnReceiveDamage onReceiveDamage { get { } }
private Rigidbody rbody; private Destructible destructible;
void Awake() { destructible = GetComponentInParent<Destructible>(); rbody = GetComponentInParent<Rigidbody>(); }
public void TakeDamage(vDamage damage) { if (ForceMultiplier <= 0f) // Default to 0.5f if for some reason ForceMultiplier hasn't been set. ForceMultiplier = 0.5f;
var point = damage.hitPosition; var relativePoint = transform.position; relativePoint.y = point.y; var forceForward = relativePoint - point;
if (rbody != null && destructible != null) { Debug.Log("[" + destructible.name + "] got hit for " + damage.damageValue + " points of damage!"); destructible.ApplyDamage(damage.damageValue); rbody.AddForce(forceForward * (damage.damageValue * ForceMultiplier), ForceMode.Impulse); } } } Thank you for the reply. This fixed the original error but created a new one that states that not all code paths return a value on line 19. look through other invector code to see how onreceivedamage get is used.
|
|
|
Post by xxscrumexx on Aug 5, 2018 5:38:59 GMT
Thank you for the reply. This fixed the original error but created a new one that states that not all code paths return a value on line 19. look through other invector code to see how onreceivedamage get is used. Thank you for the suggestion. I had also posted in the Unity forum for DestroyIt and the developer responded with the updated scripts that worked flawlessly. I thought I would pose the link to the response in case others need the info as well. forum.unity.com/threads/released-destroyit-cinematic-destruction-system.251622/page-8#post-3582429
|
|