Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
API - How to get an existing component?
#1
I have a GameObject (named "Player") with an attached SplineController.  Based on user input, I want to start/stop movement along the spline.  I tried to reference the controler
Code:
controller = GameObject.Find("Player").GetComponent("SplineController")
but I get an error that the result is a Component instead of a SplineController.  What is the correct way to access an object that already exists?
Reply


Messages In This Thread
API - How to get an existing component? - by RickPalo - 11-22-2024, 02:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I attach the component to the mesh generated from the spline? Chanon 1 1,313 02-11-2023, 09:17 AM
Last Post: _Aka_
Question Add Component to created mesh? HarvesteR 1 1,570 05-25-2022, 07:21 PM
Last Post: _Aka_
  Split existing segment(s) with additional control points KStress71 1 1,720 09-09-2021, 05:46 PM
Last Post: _Aka_
  Creating splines from the surface of existing 2d colliders Monomirror 2 2,698 08-18-2021, 03:55 PM
Last Post: Monomirror

Forum Jump: