VRTK_Playmaker3x icon indicating copy to clipboard operation
VRTK_Playmaker3x copied to clipboard

SetBezierPointerApperance.cs(67,44): error CS0029: Cannot implicitly convert type `float' to `UnityEngine.Vector2'

Open jiadong-deng opened this issue 8 years ago • 4 comments

Assets/VRTK_Playmaker3x/Pointer/PointerRenderers/BezierPointer/SetBezierPointerApperance.cs(67,44): error CS0029: Cannot implicitly convert type float' to UnityEngine.Vector2'

jiadong-deng avatar May 03 '17 01:05 jiadong-deng

Same problem here...

mavers74 avatar Aug 01 '17 15:08 mavers74

Sorry, I missed this one. I am pushing commits now for version 3.3.0 in the master. I created a branch for 3.2.0, which should help solve your issue.

ericvanderwal avatar Aug 14 '17 11:08 ericvanderwal

PS, if you are still having the issue. Simply delete that action and replace it with this one.

// Custom Action by DumbGameDev
// www.dumbgamedev.com
// Version two of this action. MaximumLength was changed from a float to a Vector2 per changes in VRTK 3.1.0

using UnityEngine;
using VRTK;

namespace HutongGames.PlayMaker.Actions
{
	[ActionCategory("VRTK Pointer")]
	[Tooltip("Set Bezier Pointer apperance.")]

	public class SetBezierPointerApperance : FsmStateAction
	{
		[RequiredField]
		[CheckForComponent(typeof(VRTK.VRTK_BezierPointerRenderer))]    
		public FsmOwnerDefault gameObject;

		public FsmVector2 maximumLength;
		public FsmInt tracerDensity;
		public FsmFloat cursorRadius;

		public FsmBool everyFrame;

		VRTK.VRTK_BezierPointerRenderer theScript;

		public override void Reset()
		{

			tracerDensity = null;
			cursorRadius = null;
			gameObject = null;
			everyFrame = false;
		}

		public override void OnEnter()
		{
			var go = Fsm.GetOwnerDefaultTarget(gameObject);


			theScript = go.GetComponent<VRTK.VRTK_BezierPointerRenderer>();

			if (!everyFrame.Value)
			{
				MakeItSo();
				Finish();
			}

		}

		public override void OnUpdate()
		{
			if (everyFrame.Value)
			{
				MakeItSo();
			}
		}


		void MakeItSo()
		{
			var go = Fsm.GetOwnerDefaultTarget(gameObject);
			if (go == null)
			{
				return;
			}

			theScript.maximumLength = maximumLength.Value;
			theScript.tracerDensity = tracerDensity.Value;
			theScript.cursorRadius = cursorRadius.Value;
		}

	}
}


ericvanderwal avatar Aug 14 '17 11:08 ericvanderwal

Thanks a lot! I'll check asap and let you know!

mavers74 avatar Aug 14 '17 15:08 mavers74