Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
12_Train junction point
#2
Hi,

It is weird that the junction doesn't seem to have an effect. Can you please follow the steps bellow, and let me know if any one of them fails?
1. Open scene 12
2. Press play
3. Do not click on the Use Junction checkbox. The train must go to the right when reaching the junction
4. Exit play mode
5. Reenter play mode
6. Click on the Use Junction checkbox. The checkbox must be become checked. The train must go to the left when reaching the junction.
FYI, the scene 12 is part of the WebGL demo too (as are most example scenes). You can test the junction there too if you wish.


Code wise, the main thing to know is the SplineController.ConnectionBehavior property, which defines how a controller behaves when reaching a junction. Bellow are links to its documentation:
· User manual: https://curvyeditor.com/documentation/co...s_handling
· API reference: https://api.curvyeditor.com/FluffyUnderw...avior.html

Example scene 12 showcases the change of this value dynamically at runtime. The steps are as follow:
1. The checkbox is part of a canvas attached to the control point with the junction (RailtrackPathA.CP0002)
2. The checkbox modifies the value of a custom control point metadata, used to store the state of the junction (script: E12_MDJunctionControl)
3. When the train reaches the junction, it reads the state of the junction, and changes the controller's ConnectionBehavior accordingly (script: E12_TrainCarManager, specifically in the OnCPReached method).

I hope these explanations helped.
Please let me know if you still have questions.

Have a nice
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply


Messages In This Thread
12_Train junction point - by richardzzzarnold - 04-10-2025, 02:52 PM
RE: 12_Train junction point - by _Aka_ - 04-13-2025, 10:50 AM
RE: 12_Train junction point - by richardzzzarnold - 04-14-2025, 11:23 AM
RE: 12_Train junction point - by _Aka_ - 04-15-2025, 09:03 AM
RE: 12_Train junction point - by richardzzzarnold - 04-16-2025, 09:39 AM
RE: 12_Train junction point - by _Aka_ - 04-16-2025, 02:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Lightbulb Junction & Connection Navigation System Design SAMYTHEBIGJUICY 6 3,490 03-25-2026, 10:10 PM
Last Post: _Aka_
  Control Point Interpolation Overrides. rickgplus 1 549 12-11-2025, 08:52 AM
Last Post: _Aka_
  OnAfterControlPointAdded - Control Point is null jh092 5 3,201 02-04-2025, 09:31 PM
Last Post: _Aka_
  How to generate gameobject on the control point Yang Yi 1 1,625 12-10-2024, 10:14 PM
Last Post: _Aka_

Forum Jump: