Chasing logic problem.

galiousgalious Member Posts: 1
edited July 2012 in Working with GS (Mac)
Hi all. I am making a logic for chasing. What I have doing is that enemy character chase the player character. Here is my logic.

Player side-----------------
game.PlayerX = self.Position.X
game.PlayerY = self.Position.Y

Enemy side---------------
Accelerate : direction: game.PlayerX Relative to actor
Accelerate : direction: game.PlayerY Relative to actor


The player character is controlable up, down, left and right with accelerate behavior. The problem is the enemy character move freely, not chase the player character.

Answers

  • HapiappsHapiapps Member Posts: 373
    edited July 2012
    Try relative to scene, if he is rotating to position, that might mess it up. Also make sure player x and y are real attributes.
  • galiousgalious Member Posts: 1
    @Hapiapps I already tried it, but nothing was changed. Player x and y are real attributes.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Hallo @galious

    If your rules:
    Player side-----------------
    game.PlayerX = self.Position.X
    game.PlayerY = self.Position.Y

    are change behaviours, make them constrain behaviours; see if that does the trick.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.