Yes !! unfortunately we have different packages I can't understand how mine would work because there is no Class called Esplode but one called ClickOrTap and yet it does explode. yours looks better though but spending another 17
Looks more like something you should put on an empty GameObject. Massive Jack Daniels hangover here, so won't attempt any further explanation today, but ok if I pm you about this tomorrow? It's really more of a Unity thing than AC-related ...
I have two scripts that I used in my pre-Adventure Creator scenes: Spawning and detect-the-player (raycasting) and I would like to have their essence incorporated into AC.
Once I find a solution for one of these scripts I can 'imitate' the mechanism to the others.
Neither one of the above actions can be implemented in AC actions unless with a convoluted scheme.
Sure I can wait I didn't expect an answer on Sunday... you see I am now retired and have ALL the time in the world.
During the weekend I made the spawning script work !!
Now I will try with the 'detect the player' script. A pity that there is no AC action list where a NPC can detect the Player by sight or noise only the Action NPC Follow which is not ebough
..... but how do I trigger this script from my scene? right now as soon as the scene runs it spawns the objects. I tried to follow the tutorial to convert this script into an ActionList but I am having problems with it. Is there any other way to 'activate' this script with AC?
and again I read a message from Chris on June 2 where he recommends to use the 'interact() ' function to call the essence of the script and it works so I don't need to make it into an ActionList just the SendMessage and Method name: interact.
Incidentally the tutorial about "Writing a custom Action " is not up to date it tells me to do things that don't exist or are changed now.
But there's no function by the name "MySpawn" in the script you posted. The Send Message Action is used to call functions within a script placed on an object - you have to make sure they match. From the sounds of it, the "cylinder" object has no script on it that includes a function by that name.
This script works. I place an empty game object (spawn2) and i include this script in. Then I do a SendMessage to spawn2 with a Method interact. It spawns 'count' number of objects.
My problem now is that in spawning these objects they are renamed with the added word (clone) and whatever I want to do with them, like say, Object:Teleport the Object with the additional (clone) word is not recognized.
====================================
using UnityEngine;
using System.Collections;
namespace AC
{
public class MySpawn: MonoBehaviour {
public GameObject prefabA;
public GameObject prefabB;
public float SpawnArea = 0f;
public int count = 0;
void interact()
{
for(int k= 0; k< count ; k++)
{
if(prefabA != null)
Instantiate(prefabA, new Vector3(Random.Range(-SpawnArea,SpawnArea),0,Random.Range(-SpawnArea,SpawnArea)), Quaternion.Euler(270f, 0, 0));
if(prefabB != null)
Instantiate(prefabB, new Vector3(Random.Range(-SpawnArea-5,SpawnArea+5),0,Random.Range(-SpawnArea-5,SpawnArea+5)), Quaternion.Euler(270f, 0, 0));
You can rename the object once you've instantiated it, but I suspect that's not what you're after. You cannot use an object created mid-game in Actions (you can, however, instantiate prefabs using Object: Add or remove and use Constant ID scripts to reference them in Actions).
This sounds like more of a scripting question, in which case I'd advise you post on the Unity forums for help.
Comments
This sounds like more of a scripting question, in which case I'd advise you post on the Unity forums for help.