Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  add vector to obi cloth
#1
Hello.
I try to add vector to obi cloth. I have a error:Cannot implicitly convert type 'UnityEngine.Vector3' to 'float', but the direction of coding is not problem?

using UnityEngine;
using System.Collections;
using Obi;

[RequireComponent(typeof(ObiActor))]
public class DistanceAnchor : MonoBehaviour
{

    ObiActor actor;
    public ObiSolver solver;
    


    void Awake()
    {
        actor = GetComponent<ObiActor>();

    }

    void Update()
    {
        ObiSolver solver = actor.Solver;

        float invMassPerParticle = 0.01f;
        for (int i = 0; i < actor.invMasses.Length; ++i)
        {
            int indexInSolver = actor.particleIndices[i];
            actor.invMasses[i] = solver.invMasses[indexInSolver];
            actor.invMasses[i] = new Vector3(0.0f, 0.05f, 0.0f);
            
        }
    }
}
Reply


Messages In This Thread
add vector to obi cloth - by Richard - 05-03-2019, 03:50 PM
RE: add vector to obi cloth - by josemendez - 05-03-2019, 04:00 PM
RE: add vector to obi cloth - by Richard - 05-03-2019, 04:05 PM
RE: add vector to obi cloth - by josemendez - 05-03-2019, 04:14 PM
RE: add vector to obi cloth - by Richard - 06-03-2019, 09:58 AM
RE: add vector to obi cloth - by josemendez - 06-03-2019, 11:57 AM