14-02-2019, 09:19 AM
(14-02-2019, 09:12 AM)Richard Wrote: I copied code like the image and added. Some two errors happened."Assets\AddConstraints.cs(14,50): error CS0411: The type arguments for method 'Component.GetComponent<T>()' cannot be inferred from the usage. Try specifying the type arguments explicitly." and "Assets\AddConstraints.cs(15,76): error CS0021: Cannot apply indexing with [] to an expression of type 'IEnumerable<ObiConstraintBatch>'". How can I solve the errors.
Hi,
Sorry, the < and > signs weren't rendering properly in the page. We've corrected it. The code should be:
Code:
ObiDistanceConstraints constraints = GetComponent<ObiDistanceConstraints>();
ObiDistanceConstraintBatch batch = (ObiDistanceConstraintBatch)constraints.GetFirstBatch();