|
Post by pararini on Nov 28, 2018 22:03:55 GMT
is anyone interested on an parachute addon?
if yes, i'll do the work of integrating my system into the invector inventory With Inventory Pro works fine.
|
|
|
Post by game4fun on Nov 30, 2018 21:35:58 GMT
wow amazing work )))
|
|
|
Post by Yort_Draeb on Dec 2, 2018 22:37:09 GMT
how much are you planning to ask for it?
|
|
|
Post by pararini on Dec 3, 2018 6:37:52 GMT
Not so much, but I do not the work if it nobody wants
|
|
|
Post by Yort_Draeb on Dec 3, 2018 17:13:36 GMT
Not so much, but I do not the work if it nobody wants What do you mean?
|
|
|
Post by darknubis365 on Dec 8, 2018 10:05:19 GMT
Not so much, but I do not the work if it nobody wants What do you mean? If nobody wants he wont finish the project
|
|
|
Post by Yort_Draeb on Dec 8, 2018 15:25:56 GMT
If nobody wants he wont finish the project Its tough to know if its worth the price if there is no price though
|
|
|
Post by darknubis365 on Dec 8, 2018 23:09:55 GMT
Im all for charging for addons but this community needs more free addons i wish someone would share some post or something as to how they going about writing these addons or is that the point to try and sell?And im not talking about this parachute one but just saying all the other addons,I'd be interested in this if i were going make a shooter game but others might need you just have to post previews and see who wants it.It looks good btw
|
|
|
Post by kaenna on Dec 16, 2018 15:25:58 GMT
I'd definitely be interested in it. If you haven't posted this on the Unity community site as well, you should, so more people can see and indicate whether they'd like it as well. It looks promising!
|
|
|
Post by pararini on Dec 16, 2018 17:14:13 GMT
After the next invector update I will continue to work on it and share it
|
|
|
Post by pararini on Dec 16, 2018 17:17:39 GMT
if someone wants to continue
but only works with inventory pro
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Invector;
using Invector.vCharacterController;
using Invector.vMelee;
using Invector.vShooter;
using UnityEngine.Events;
using Devdog.InventoryPro;
namespace Invector.vCharacterController.vActions
{
[vClassHeader("Parachute Action")]
public class vParachute : vActionListener
{
#region public variable
public GameObject Parachute;
public GameObject ParachutePlace;
public GenericInput openParachute = new GenericInput("Space", "X", "X");
public GenericInput exitparachute = new GenericInput("F", "X", "X");
public GenericInput speedFall = new GenericInput("LeftShift", "Y", "Y");
public Vector3 RightHandIK;
public Vector3 LeftHandIK;
public EquippableInventoryItem Item;
[Header("UI")]
public GameObject canEnter;
public GameObject CanExit;
[Header("Animations Clips & Tags")]
public string ParachuteClip = "Parachute";
[Header("Speed & Extra Options")]
[Tooltip("The Velocity to start falling ")]
public float verticalVelocity = -12f;
#endregion
#region private variablen
private vThirdPersonController vController;
private vThirdPersonInput tpInput;
private Rigidbody RB;
private vFallDamageManager Fallmanager;
private vWeaponInventoryHolder WeaponHolder;
private vVehicleUI VehicleUI;
public bool inParachute;
public bool canParachute;
public bool hasParachute = true;
#endregion
public UnityEvent inAir;
public UnityEvent onParachute;
public UnityEvent onParachuteExit;
private void Start()
{
tpInput = GetComponent<vThirdPersonInput>();
vController = GetComponent<vThirdPersonController>();
RB = GetComponent<Rigidbody>();
Fallmanager = GetComponent<vFallDamageManager>();
WeaponHolder = GetComponent<vWeaponInventoryHolder>();
VehicleUI = FindObjectOfType<vVehicleUI>().GetComponent<vVehicleUI>();
VehicleUI.Exit.SetActive(false);
VehicleUI.Enter.SetActive(false);
}
public void SetParachute(EquippableInventoryItem obj)
{
Item = obj;
hasParachute = true;
// var Parachute = obj.Parachute;
var newParachute = Instantiate(obj.Parachute, ParachutePlace.transform);
Parachute = newParachute;
if (obj.Parachute.GetComponent<vParachuteObject>())
{
var myParachute = obj.Parachute.GetComponent<vParachuteObject>();
newParachute.transform.localPosition = myParachute.LocalTransform;
}
else
{
newParachute.transform.localPosition = new Vector3(0, 0, 0);
newParachute.transform.localRotation = new Quaternion(0, 0, 0, 0);
}
}
public void DeleteParachute(bool used)
{
hasParachute = false;
Destroy(Parachute);
if (used)
{
Item.UsedParachute();
Destroy(Item);
}
}
protected virtual void Update()
{
if (!vController.isGrounded && !inParachute && hasParachute)
{
if(vController.verticalVelocity < verticalVelocity)
{
canParachute = true;
inAir.Invoke();
VehicleUI.Enter.SetActive(true);
}
else
{
canParachute = false;
}
}
else
{
canParachute = false;
}
if (hasParachute && !inParachute && canParachute && openParachute.GetButtonDown())
{
inParachute = true;
Fallmanager.startYPos = 0;
Fallmanager.endYPos = 0;
ParachutePlace.SetActive(true);
RB.drag = 3;
VehicleUI.Enter.SetActive(false);
VehicleUI.Exit.SetActive(true);
WeaponHolder.WeapontoHolder();
onParachute.Invoke();
}
ParachuteBehaiver();
}
private void FixedUpdate()
{
if(inParachute && hasParachute)
{
var obj = Parachute.GetComponent<vParachuteObject>();
float horizontal = tpInput.horizontalInput.GetAxis();
float vertical = tpInput.verticallInput.GetAxis();
obj.anim.SetFloat("Horizontal", horizontal);
obj.anim.SetFloat("Vertical", vertical);
}
}
void ParachuteBehaiver()
{
//in Para
if (inParachute)
{
tpInput.cc.animator.CrossFadeInFixedTime(ParachuteClip, 0.25f, 0);
tpInput.cc.animator.CrossFadeInFixedTime(ParachuteClip, 0.25f, 1);
tpInput.cc.animator.SetInteger("ActionState", 1);
Fallmanager.startYPos = 0;
Fallmanager.endYPos = 0;
if (vController.isGrounded)
{
ExitParachute();
}
}
if (inParachute && exitparachute.GetButtonDown())
{
VehicleUI.Exit.SetActive(false);
ExitParachute();
}
}
private void OnAnimatorIK(int layerIndex)
{
if (inParachute && !tpInput.cc.animator.GetBool("IsAiming"))
{
if (Item.Parachute.GetComponent<vParachuteObject>())
{
var ikParachute = Parachute.GetComponent<vParachuteObject>();
tpInput.cc.animator.SetIKPositionWeight(AvatarIKGoal.RightHand, 1f);
tpInput.cc.animator.SetIKRotationWeight(AvatarIKGoal.RightHand, 1f);
tpInput.cc.animator.SetIKPosition(AvatarIKGoal.RightHand, ikParachute.RighthandIK.position);
tpInput.cc.animator.SetIKRotation(AvatarIKGoal.RightHand, ikParachute.RighthandIK.rotation);
tpInput.cc.animator.SetIKPositionWeight(AvatarIKGoal.LeftHand, 1f);
tpInput.cc.animator.SetIKRotationWeight(AvatarIKGoal.LeftHand, 1f);
tpInput.cc.animator.SetIKPosition(AvatarIKGoal.LeftHand, ikParachute.LeftHandIK.position);
tpInput.cc.animator.SetIKRotation(AvatarIKGoal.LeftHand, ikParachute.LeftHandIK.rotation);
tpInput.cc.animator.SetIKPositionWeight(AvatarIKGoal.RightFoot, 1f);
tpInput.cc.animator.SetIKRotationWeight(AvatarIKGoal.RightFoot, 1f);
tpInput.cc.animator.SetIKPosition(AvatarIKGoal.RightFoot, ikParachute.RFootIK.position);
tpInput.cc.animator.SetIKRotation(AvatarIKGoal.RightFoot, ikParachute.RFootIK.rotation);
tpInput.cc.animator.SetIKPositionWeight(AvatarIKGoal.LeftFoot, 1f);
tpInput.cc.animator.SetIKRotationWeight(AvatarIKGoal.LeftFoot, 1f);
tpInput.cc.animator.SetIKPosition(AvatarIKGoal.LeftFoot, ikParachute.LFootIK.position);
tpInput.cc.animator.SetIKRotation(AvatarIKGoal.LeftFoot, ikParachute.LFootIK.rotation);
}
}
if(inParachute && tpInput.cc.animator.GetBool("IsAiming"))
{
tpInput.cc.animator.SetIKPositionWeight(AvatarIKGoal.LeftHand, 0f);
tpInput.cc.animator.SetIKRotationWeight(AvatarIKGoal.LeftHand, 0f);
tpInput.cc.animator.SetIKPositionWeight(AvatarIKGoal.RightHand, 0f);
tpInput.cc.animator.SetIKRotationWeight(AvatarIKGoal.RightHand, 0f);
}
}
void ExitParachute()
{
DeleteParachute(true);
inParachute = false;
ParachutePlace.SetActive(false);
RB.drag = 0;
tpInput.cc.animator.SetInteger("ActionState", 0);
Fallmanager.startYPos = 0;
Fallmanager.endYPos = 0;
onParachuteExit.Invoke();
}
}
}
and the Inventory Item
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class vParachuteObject : MonoBehaviour {
public Transform LeftHandIK; public Transform RighthandIK;
public Transform RFootIK;
public Transform LFootIK;
public Vector3 LocalTransform = new Vector3(0,0,0);
public Animator anim;
private void Start()
{
anim = GetComponent<Animator>();
}
}
|
|