Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Debug message when moving over CP not working.
#1
Hi,

I'm looking for a little guidance with an issue I'm having.

I've created a based spline and would like a debug message displayed when my GameObject moves over each CP.

I've put together the following script and applied it to a Game Object. Unfortunately, it doesn't seem to be working. Any ideas?


Code:
using FluffyUnderware.Curvy;
using FluffyUnderware.Curvy.Controllers;
using UnityEngine;

public class CheckPoint : MonoBehaviour
   {

       public void OnCPReachedHandler(CurvySplineMoveEventArgs e)
       {
           // what CP have we moved over?
           Debug.Log(e.ControlPoint);
       }
   }
Reply
#2
Hi,
SplineControllers have an OnControlPointReached. This is a Unity event, so you can use it like any other Unity event.
Does this help?
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
(07-08-2019, 01:35 PM)_Aka_ Wrote: Hi,
SplineControllers have an OnControlPointReached. This is a Unity event, so you can use it like any other Unity event.
Does this help?
Have a nice day

Thanks but I've tried the unity event that and it doesn't appear to be working. So frustrating.

https://imgur.com/a/5YSvcvn

Any other ideas?

Thanks in advance
Reply
#4
I don't know what you did wrong in your setup. I attached a scene, that uses your script, where I could attach the event handler. Does it work in your project? If not, what version of Curvy are you using?


Attached Files
.zip   Event.zip (Size: 4.16 KB / Downloads: 8)
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#5
Thank you! It's working now. I was dragging the game object script from the wrong place.
Reply
#6
You are welcome
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  how to make fast moving controller go all the way to linear points?(curvy8) hawken 7 7 06-06-2023, 09:47 AM
Last Post: _Aka_
Photo Position in Input Spots not working on all directions. Mike Danielsson 2 9 09-03-2022, 02:22 PM
Last Post: Mike Danielsson
  Obstacle Moving Along the spline Chanon 1 7 06-13-2022, 04:13 PM
Last Post: _Aka_
  Message to 유 한일 _Aka_ 0 6 03-24-2022, 12:49 PM
Last Post: _Aka_

Forum Jump: