Hi,
How do you store /load default item/equipment transformations for an RPG game?
At this point, it looks like I will need several default transformations for each prefab item. One for each character model and another set for when the item is on the ground.
One thought I had was that I could create game objects for each default transformation state and use them to store the default transformations for each item.
For example, the code for loading the item in the left hand might look like this.
obj = Instantiate(SwordPrefab, LeftHandObject.transform);
obj.transform.localPosition = DefaultITrans[(int) ItemTransform.Sword02LeftHand].transform.position;
obj.transform.localRotation = DefaultTrans[(int) ItemTransform.Sword02LeftHand].transform.rotation;
Another solution is to use an external xml file, but it would be cumbersome to work with since I couldn’t copy and paste transform values.
Of course, animations for each item object are another option.
What do you guys suggest is the best option? Is there a standard way of storing/ loading transformation information? Keep in mind that my game has hundreds of items used by several character models of different shapes and sizes. .
Any ideas and suggestions you may have would be appreciated. Thanks
This is what I’m trying now. The problem is that it only works for one model.