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
Bug Issues when working with in-place prefabs Sacryn 4 6 02-27-2024, 04:08 PM
Last Post: _Aka_
  Moving object down or up the spline using gravity velikizlivuk 6 16 07-26-2023, 10:06 PM
Last Post: _Aka_
  how to make fast moving controller go all the way to linear points?(curvy8) hawken 7 12 06-06-2023, 09:47 AM
Last Post: _Aka_
Photo Position in Input Spots not working on all directions. Mike Danielsson 2 10 09-03-2022, 02:22 PM
Last Post: Mike Danielsson

Forum Jump: