playMaker

Author Topic: Canvas is a namespace but is used like a type RectTransform Actions errors  (Read 952 times)

DigitalDesignSvc

  • Playmaker Newbie
  • *
  • Posts: 5
Unity Version 2020.3.22f1
Playmaker Version 1.9.4.f2 - Nov 4, 2021

Followed the asset store bug removal thread and redownloaded the current version.  Installed successfully.  Upon installation finish Unity immediately threw up six errors on the RectTransform actions.  They all indicate the same error "CS0118: 'Canvas' is a namespace but is used like a type".

DigitalDesignSvc

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Canvas is a namespace but is used like a type RectTransform Actions errors
« Reply #1 on: February 03, 2022, 12:03:59 PM »
More details to follow on.  Here is the first script error (RectTransformPixelAdjustPoint.cs(31,3):

Code: [Select]
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("RectTransform")]
[Tooltip("Convert a given point in screen space into a pixel correct point.")]
public class RectTransformPixelAdjustPoint : BaseUpdateAction
{
[RequiredField]
[CheckForComponent(typeof(RectTransform))]
[Tooltip("The GameObject target.")]
public FsmOwnerDefault gameObject;

[RequiredField]
[CheckForComponent(typeof(Canvas))]
[Tooltip("The canvas. Leave to none to use the canvas of the gameObject")]
public FsmGameObject canvas;

[Tooltip("The screen position.")]
public FsmVector2 screenPoint;

[ActionSection("Result")]
[RequiredField]
[Tooltip("Pixel adjusted point from the screen position.")]
[UIHint(UIHint.Variable)]
public FsmVector2 pixelPoint;

RectTransform _rt;
Canvas _canvas;

The error is occurring on the last line above.  In Visual Studio there is a red squiggly line under the "Canvas" in line 17

Code: [Select]
[CheckForComponent(typeof(Canvas))]
as well as the line 31
Code: [Select]
Canvas _canvas;
and 55
Code: [Select]
_canvas = goCanvas.GetComponent<Canvas>();
« Last Edit: February 03, 2022, 12:07:10 PM by DigitalDesignSvc »