|
Post by redmotion on Jul 6, 2018 16:36:41 GMT
How do i force automatic unequip of bow or other weapons when walking into freeclimb surface? Or block climbing until it is removed?
I ask this because the bow stays equipped when changing into a climb:-
Is it possible to have the bow appear on the characters back rather than disappear when unequipped or switched out?
Arrows get distorted when they hit the surface of an object that has been scaled.
Using Unity 2017.4.1f1
|
|
|
Post by Legion on Jul 6, 2018 17:56:28 GMT
Can't talk about the first question, we don't own the Freeclimb addon, but about the second one, the arrows become children of the object with which they impact, so they change the scale to which the parent object has; we haven't looked at the code for this, but maybe you can store the scale before parenting and reapply it again after.
Edit: Does the addon not have an event called "On Climb Start" or something similar in which you can call the function of Unequip weapons?
|
|
|
Post by dakurlz on Jul 6, 2018 18:17:47 GMT
Can't talk about the first question, we don't own the Freeclimb addon, but about the second one, the arrows become children of the object with which they impact, so they change the scale to which the parent object has; we haven't looked at the code for this, but maybe you can store the scale before parenting and reapply it again after. Edit: Does the addon not have an event called "On Climb Start" or something similar in which you can call the function of Unequip weapons? I have a similar problem with the swim addon. Tell me, where is the function "Unequip weapons"? Is she in a ShooterIput or an ShooterManager?
|
|
|
Post by redmotion on Jul 6, 2018 20:54:14 GMT
Can't talk about the first question, we don't own the Freeclimb addon, but about the second one, the arrows become children of the object with which they impact, so they change the scale to which the parent object has; we haven't looked at the code for this, but maybe you can store the scale before parenting and reapply it again after. Edit: Does the addon not have an event called "On Climb Start" or something similar in which you can call the function of Unequip weapons? I couldn't find an event that allows you to unequip the currently held object. There is one that looks close: vItemManager.UnequipItem but I don't think it's for weapons. API docs are sparce.
An event that unequipped the held weapon while you climbed and then reequiped it when you come out would also be helpful.
|
|
|
Post by redmotion on Jul 7, 2018 7:05:45 GMT
So I think I fixed the arrow scaling issue by adding this at the end of OnDestroyProjectile method in vArrow.cs:
detachObject.parent = null; detachObject.localScale = new Vector3 (0.1f, 0.1f, 0.1f);
It's probably some terrible programming faux par, but it works for me.
|
|
|
Post by Legion on Jul 7, 2018 16:46:01 GMT
Can't talk about the first question, we don't own the Freeclimb addon, but about the second one, the arrows become children of the object with which they impact, so they change the scale to which the parent object has; we haven't looked at the code for this, but maybe you can store the scale before parenting and reapply it again after. Edit: Does the addon not have an event called "On Climb Start" or something similar in which you can call the function of Unequip weapons? I have a similar problem with the swim addon. Tell me, where is the function "Unequip weapons"? Is she in a ShooterIput or an ShooterManager? We've looked and we haven't found a function to unequip weapons, but you can collect all the handlers under the same gameobject and activate or deactivate it through the events (as in the example character and the vThrowObject script). The vSwimming script have two functions, OnActionEnter and OnActionExit, maybe you can create two unity events inside each one to perform the action of activating and deactivating the gameobject respectively.
|
|