Difference between revisions of "Talk:OnTrigger"
imported>Antares (Info on the behaviour of OnTrigger Blocks) |
imported>Antares (→BlockType Behaviour: It would seem that OnTrigger and GameMode blocks clash within the same script) |
||
Line 13: | Line 13: | ||
It would appear that this function behaves like a GameMode block in that it won't run in other modes (MenuMode). I tried to use this function to circumvent an effectshader called on an object in GameMode from not being run in other modes. I needed a seperate script for this due to the dynamic nature of the object I was adding. I also needed a way to retrieve a reference to the dynamic object inside the seperate script so I thought creating a TrigZone and using an OnTrigger block would be the end of my problems, obviously not. OnLoad would work perfectly but I cannot see way to run [[OnLoad]] on a dynamic reference.<BR> | It would appear that this function behaves like a GameMode block in that it won't run in other modes (MenuMode). I tried to use this function to circumvent an effectshader called on an object in GameMode from not being run in other modes. I needed a seperate script for this due to the dynamic nature of the object I was adding. I also needed a way to retrieve a reference to the dynamic object inside the seperate script so I thought creating a TrigZone and using an OnTrigger block would be the end of my problems, obviously not. OnLoad would work perfectly but I cannot see way to run [[OnLoad]] on a dynamic reference.<BR> | ||
--[[User:Antares|Antares]] 23:34, 7 September 2008 (EDT) | --[[User:Antares|Antares]] 23:34, 7 September 2008 (EDT) | ||
::Further information on BlockType Behaviour for this function: It would seem that when you try to run a '''GameMode''' block '''inside''' a script that has an '''OnTrigger''' block they will conflict. I was pulling my hair out wondering why my OnTrigger wasn't being triggered, I removed my Gamemode block because I changed my method and the code within became redundant and voila! it was all better. Just thought this would be useful information. | |||
::--[[User:Antares|Antares]] 02:46, 22 September 2008 (EDT) |
Revision as of 01:46, 22 September 2008
Triggering Reference
How do you get a reference to the triggering object? I have setup a trigzone and want to retrieve a reference for the object responsible for the trigger. This object is added to the game dynamically.
--Antares 09:42, 7 September 2008 (EDT)
- GetActionRef
- Dragoon Wraith TALK 10:41, 7 September 2008 (EDT)
- The Man, thanks DragoonWraith, I thought it would be something simple. I am updating the article "See Also" section for both OnTrigger and GetActionRef.
- --Antares 22:36, 7 September 2008 (EDT)
BlockType Behaviour
It would appear that this function behaves like a GameMode block in that it won't run in other modes (MenuMode). I tried to use this function to circumvent an effectshader called on an object in GameMode from not being run in other modes. I needed a seperate script for this due to the dynamic nature of the object I was adding. I also needed a way to retrieve a reference to the dynamic object inside the seperate script so I thought creating a TrigZone and using an OnTrigger block would be the end of my problems, obviously not. OnLoad would work perfectly but I cannot see way to run OnLoad on a dynamic reference.
--Antares 23:34, 7 September 2008 (EDT)
- Further information on BlockType Behaviour for this function: It would seem that when you try to run a GameMode block inside a script that has an OnTrigger block they will conflict. I was pulling my hair out wondering why my OnTrigger wasn't being triggered, I removed my Gamemode block because I changed my method and the code within became redundant and voila! it was all better. Just thought this would be useful information.
- --Antares 02:46, 22 September 2008 (EDT)