|
Post by gigagiga on Dec 19, 2017 8:21:58 GMT
I would like to ask a basic methodology on how to use the invector's shooter template and Ultimate survival asset to change the item in the player's hand during development.
I would like to temporarily change the weapon in my hand while trying to implement the action of digging a ground with a shovel by pressing a certain button.
How can I change this in my script?
I thought I'd replace the mounted weapon with an externally accessible command from the itemmanager or shootermanager
Those components do not seem to have that capability.
|
|
|
Post by Legion on Dec 19, 2017 10:11:08 GMT
It would be easier than during the action of digging, the weapon is holstered and a mesh renderer is activated in the hand with a shovel/pickaxe or something like that (Skyrim style).
Edit: You can take a look on the grenade script in the demo to know how to block movement, input and so on during the action.
|
|
|
Post by gigagiga on Dec 20, 2017 2:50:49 GMT
Depending on your advice I have searched the Grenade script. I did not think there would be something like Grenade.cs, so I found something similar. As a result, it was judged that vThrowObject.cs was close to the grenade script that we were talking about. However, the script did not show commands or code such as "active / inactive" or "mount / unmute" accessing something like a weapon.
Am I missing something?
|
|
|
Post by witcher on Dec 21, 2017 6:17:28 GMT
gm = Instantiate(myweapon[weaponprefab]); gm.transform.SetParent(EquipPoint); gm.transform.localPosition = Vector3.zero; gm.transform.localEulerAngles = Vector3.zero; GetComponent<vShooterManager>().SetRightWeapon(gm);
|
|
|
Post by Legion on Dec 21, 2017 8:08:51 GMT
It's that everything depends on how you want to do it, our way, as we said, is the Skyrim mining system. Using vItemCollection.cs, you can perform the action of digging in a certain trigger, and, in addition, receive items from the list of items; at the same time, with the events "On Do Action", "On Player Enter", etc, you can control how the character will behave (hence the advice to take a look at the grenade script, vThrowObject, yes.)
If you take a look at the events of that script in the demo, you will see that you can activate or deactivate, call, etc, certain things while doing the action.
You can start with "On Do Action", dragging a mesh renderer already deactivated in the character's hand and making it activate by "GameObject.SetActive", as well as blocking the movement through vShooterMelee.Input.SetLockMeleeInput and vShooterMelee.Input.SetLockshooterInput; at the same time, in "On Player Exit", you can leave everything as it was when the action ends.
|
|