Collision Issues

FallacyStudiosFallacyStudios Member Posts: 970
edited February 2012 in Working with GS (Mac)
I have some problems with collision I am trying to work out. I have an enemy that is walking across the X plane. When it reaches a tower I would like it to stop moving and attack. When the tower is dead I would like it to continue walking forward.

-Right now the enemy has a Change Attribute that has Linear Velocity X at 30 (also tried with Move To). (Also tried this in a timer set to after .01 seconds run to completion)
-It has a rule that when it collides with a tower that it changes the Linear Velocity X to 0 (also tried with Move To).
-It has another rule that says when it collides with destroyed tower (which is spawned when the tower is destroyed exactly in its place) that its Linear Velocity X is set to 30 again (also tried with Move To).

None of this works correctly. The enemy just keeps walking along hits the target and keeps trying to walk along. If the tower is destroyed for some reason it stops moving all together and just stands there. If it hits a corner of the tower it begins to spin upward (or downward if on the bottom). Any ideas?

**I have also tried this with a Moving boolean inside of the enemy actor. (If true move at 30 if false move at 0) Does the same stuff.

Comments

  • POMPOM Member Posts: 2,599
    Do you have rules in the "otherwise" sections of the collisions?

    Roy.
  • FallacyStudiosFallacyStudios Member Posts: 970
    @P-O-M No I don't usually use the otherwise because it seems like most times it doesn't read it if it is changed dynamically so it is set as two separate rules (So one rule for true one rule for false)
  • POMPOM Member Posts: 2,599
    edited February 2012
    I made this quick template for ya , take a look and see how things should work in tower defense the way you describe them in your post :
    http://www.mediafire.com/?ik0kyw2bdwc62x0
    Fixed the link.

    Roy.
  • FallacyStudiosFallacyStudios Member Posts: 970
    @POM You sure that is the correct link? Or did you want me to upload my template so you can take a look?
  • POMPOM Member Posts: 2,599
    Sorry... fixed it.

    Roy.
  • FallacyStudiosFallacyStudios Member Posts: 970
    edited February 2012
    @POM Thanks it's working now. I appreciate the help
  • FallacyStudiosFallacyStudios Member Posts: 970
    @POM The weird thing is... it seems like the biggest difference between what I had tried and your version was that I used tags for the towers. Maybe it wasn't registering those correctly?
  • POMPOM Member Posts: 2,599
    It should register them , but if you use them in a wrong way , they can mess up the logic , can you list the relevant tags? and what actors are in them?

    Roy.
  • FallacyStudiosFallacyStudios Member Posts: 970
    edited February 2012
    @POM Well it was the Tower tag and Enemy Tag. The only actors in each was tower in tower and enemy in enemy. It's fine though I'll just list each of the actors since there wont be too many.

    I appreciate all your help though
Sign In or Register to comment.