[Notice of Holidays]
Please note that our staff will not be available from 2024/Dec/28 - 2025/Jan/5 JST.
The Live2D Creators Forum will remain open during the holidays.
Submissions that require a response will be answered after we reopen for business.
Please note that it will take longer than usual to respond to your request.
Instantiate prefab loos motion smothness.
Hi,
I create small test script and assigned it to a prefab imported with Live2D model.
using Live2D.Cubism.Core;
using UnityEngine;
public class TmpBaseMovement : MonoBehaviour {
public string ParameterID;
private CubismModel _cubismModel;
private CubismParameter _cubismParam;
private float n = 0;
private void Start() {
_cubismModel = gameObject.FindCubismModel();
_cubismParam = _cubismModel.Parameters.FindById(ParameterID);
}
private void LateUpdate() {
n += 3 * Time.deltaTime;
_cubismParam.Value = Mathf.Sin(n) * 30;
}
}
When I added prefab to hierarchy move is fluent and smooth. When I instantiate the same prefab by `Instantiate(ModelPrefab)` then move is hard and straight, like be all physics not work at all.
Why that happens and where I should looking for fix?
Live2D Cubism version - [4-r.5] - 2022-09-08
Unity 2021.2.13f1
0 ·
Answers
Anyway I want to understand why it was happened. Can you recommend me some article/tutorial which can help me understand problem of script execution, and why instantiate prefab give mu effect described above.
Update:
I already find a solution https://docs.live2d.com/en/cubism-sdk-tutorials/using-update-controller/ - Implementation of `ICubismUpdatable` interface help a lot.