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: 4)
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
  Refresh spline doesn't seem to be working dazz777 4 56 11-13-2019, 11:13 PM
Last Post: _Aka_
  Spline events not working in IL2CPP build (Android) callen_mrez 6 1,148 06-04-2019, 09:24 PM
Last Post: _Aka_
  Adding a Control point Not working as espected UsernameHed 1 501 05-19-2019, 01:43 PM
Last Post: _Aka_
  Moving freely on the Y axis? clearleaf 3 683 05-14-2019, 12:31 PM
Last Post: _Aka_

Forum Jump: