Jump to content
Aveyond Studios Community
  • 1
ChibaShouten

RpgController 2D (script) is invalid

Question

Hi , Ant!

It is hard to explain, but I will try it.😅

1. Generate 10 spawn objects.
2. While moving randomly, head to the player.
3. When the player is running away, some of the objects spawned eventually stop. It is about half.
4. When checking with the inspector, RpgController 2D (script) was turned off.

Even if you change the number of spawn objects, it stops.

2018-05-29-165830_1920x1080_scrot.png

2018-05-29-165621_1920x1080_scrot.png

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

@ChibaShouten, can you tell me which game object had the RpgController2D turned off? Was it the one that you wanted  to destroy?

I know you've found a workaround, but I want to make sure the Destroy Hero Object is working properly. That action should have deleted the game object from the Hierarchy tab, but it sounds like it may have done something else.

Share this post


Link to post
Share on other sites
  • 0

Hi , Ant!

It is before modification.
1. Randomly created 10 gold
2. randomly spawn 10 enemies randomly
3. Enemies move randomly and chase players
4. The player picks up "gold" and gold is destroyed. (I changed "Destroy Hero Object" to "Turn Hero Object Off")
5. Finally, the random motion of the enemy stops and synchronizes with the movement of the player. This is like imitating the player's movement without following the player. For example, go to the right when you go to the right, and move to the left when you move to the left.

1 hour ago, Ant said:

@ChibaShouten, can you tell me which game object had the RpgController2D turned off? Was it the one that you wanted  to destroy?

I wanted to destroy "gold".

1 hour ago, Ant said:

That action should have deleted the game object from the Hierarchy tab, but it sounds like it may have done something else. 

I do not remember details of trial and error, but "RpgController 2D" became normal by changing "Destroy Hero Object" to "Turn Hero Object Off".
Trial and error is moving the state to an empty object, changing the action, and so on.

I am studying Unity and HeroKit, so I do not know the difference between "Destroy Hero Object" and "Turn Hero Object Off".
There is no change in the fact that the object "disappears", so I do not know the difference.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×