Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Apr 08, 2016 at 11:47 AM by Baste for the following reason:

Question regards a third party framework. See comments for a link to the question in Fungus' forums.

avatar image
0
Question by Reverend-Speed · Apr 07, 2016 at 11:53 PM · physicsontriggerentereventoncollisionenter

Fungus C# ExecuteBlock() won't execute when triggered by collision or trigger enter…!

Hey folks, long time C#/Unity user, first time Fungus user with a baffling conundrum for you. Having followed Youtube Fungus tutorial 16 (Extending Fungus), I sought to trigger a Fungus flow on the interaction of two rigidbodies (initially with OnCollisionEnter, then later OnTriggerEnter).

I'm ‘using Fungus’, I'm inheriting from EventHandler and I intended calling ExecuteBlock() from OnCollisionEnter… But while other commands in the OnCollisionEnter event (and inside the CompareTag if statement) ran (including some Debug.Logs), I couldn't get ExecuteBlock() to start the next block in the Flowchart chain to run!

And then I did a simple “if(input.GetKeyDown(KeyCode.Space) ExecuteBlock()” in Update and the bloody thing works!

So I figured that this had to be executed in Update, perhaps, so I tried making it run in an if statement which evaluated a bool set by the collision. No such luck.

I even tried making it work with the Invoke command that was demonstrated in the video – nope, nope, nope.

What on earth is going on here? I'm sure there's something obvious (multiple typos? God, I hope not) at root cause – perhaps somebody here can see the issue. Again, to restate: it's working on a simple buttonpress, NOT when it has something to do with an on enter collision/trigger.

Any thoughts? Screenshot and code follow… —Rev alt text

 using UnityEngine;
 using System.Collections;
 using Fungus;
 
 [EventHandlerInfo("Scripting", "LarryMazeEndzone", "Prevents Larry from moving, executes end cutscene")]
 public class Endzone : EventHandler {
 
     private StageManager    stageManager;
     //private Flowchart       flowChart;
 
     private bool completed = false;
 
     // Use this for initialization
     void Start () {
         stageManager = GameObject.Find("Main Camera").GetComponent<StageManager>();
         //flowChart = GameObject.Find("Flowchart").GetComponent<Flowchart>();
     }
 
     void Update()
     {
         if (completed)
         {
             ExecuteBlock(); // This does not run.
             Debug.Log("Completed");
         }
 
         if (Input.GetKey(KeyCode.Space))
         {
             ExecuteBlock(); // This does run - even when I hold down spacebar!
             Debug.Log("Space pressed");
         }
     }
 
     void OnTriggerEnter (Collider other)
     {
         Invoke("ExecuteDammit",0.0f);
         completed = true;
         Debug.Log("Detected object");
         if (other.transform.CompareTag("Larry"))
         {
             ExecuteBlock(); // This does not run...! (Obviously, this is the version I really want to be able to use)
             Debug.Log("Touched Endzone!");
             stageManager.CutsceneStarting();
             Debug.Log("Executed Block, supposedly.");
         }
     }
 
     void ExecuteDammit ()
     {
         Debug.Log("Method invoked...");
         ExecuteBlock(); // No good, not executing.
     }
 }


fungusproblems.png (285.2 kB)
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Reverend-Speed · Apr 08, 2016 at 11:36 AM 0
Share

Using the following code I was able to workaround the issue, but I'd still appreciate a response on ExecuteBlock() if possible...

 public class Endzone : $$anonymous$$onoBehavior {
 void OnTriggerEnter (Collider other)
 {
 Flowchart.BroadcastFungus$$anonymous$$essage(“ENTERED_ENDZONE”);
 }
 }
avatar image Vandive · Apr 08, 2016 at 11:40 AM 0
Share

It is hard to get an answer to something that isn't built into unity and not everyone has. Have you tried asking the creator of fungus?

avatar image Baste · Apr 08, 2016 at 11:44 AM 0
Share

For questions about specific frameworks (like Fungus), it's often better to ask that framework's community in general, rather than the Unity-wide Answers.

Fungus has it's own forums, try there. You're more likely to find help.

I hadn't heard about Fungus before I read your question.

EDIT: I see you've already posted there. I'll close this question. The thread on the Fungus forums are here.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

60 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

,Fast Moving Gameobject Collision and Trigger Check Failed 0 Answers

Character controller collider? 0 Answers

Car smashing through crowd- Collision issue. 1 Answer

collision between two gameobjects not working 1 Answer

Play Audio on Collision or Trigger Enter 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges