private void OnTrigger(CollisionData data) { try { AgentPrivate agent = ScenePrivate.FindAgent(data.HitComponentId.ObjectId); if (data.Phase == CollisionEventPhase.TriggerExit) { agent.SetGravityFactor(1.0f); } else if (data.Phase == CollisionEventPhase.TriggerEnter) { agent.SetGravityFactor(gravityFactor); } } catch (NullReferenceException nre) { Log.Write(LogLevel.Info, "NullReferenceException setting agent gravity factor (maybe the user left): " + nre.Message); } catch (Exception e) { Log.Write(LogLevel.Error, "Exception setting agent gravity factor: " + e.Message); } }
public void OnClick(InteractionData data) { // Find the agent that clicked. AgentPrivate agent = ScenePrivate.FindAgent(data.AgentId); // Lower gravity for the agent that clicked agent.SetGravityFactor(gravityFactor); //Send the quest event SendQuestEvent(questCommand, agent); }