Constraining an Invisible actor to the body of another actor

Slayre77Slayre77 Member, PRO Posts: 115
I have 2 humanoid actors (in terms of the art) holding knives in a stabbing position in front of them. The behaviour is to move back a little when they touch each iother while subtracting a value from their 'HP'. But its absurd-looking because the area where they meet is the knife, so they move back and later die without even touching each other's body, just the tip of the knife touching briefly. I have an idea to fix it : Make an invisible actor with the same behaviour (removing the behaviurs from the first actors) and constraining it to the body of the humanoids.
1.How??
2.Is there an easier/ better way?

Thanks :)

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2013
    Yes, that's the way to do it, except you want to constrain the main actor with the image to the invisible actor, not the other way around. So, you'll want to make a smaller invisible actor that the larger actor (with the image) follows - and put all the rules in the smaller invisible actor.

    Make two global (game) attributes MrStabberMan X and MrStabberMan Y.

    Place two rules in the invisible actor:
    Constrain MrStabberMan X to self.position X
    Constrain MrStabberMan Y to self.position y

    Then place two rules in the larger actor with the image:
    Constrain self.position X to MrStabberMan X
    Constrain self.position Y to MrStabberMan Y

    Now the larger actor with the image will track the smaller invisible actor.
  • Slayre77Slayre77 Member, PRO Posts: 115
    @Socks to the rescue again xD! Thanks :D
    Smiley
  • Slayre77Slayre77 Member, PRO Posts: 115
    Ohh great just as i Though it was working... the moment I press preview, the actors immediately get bundled together at the bottom right corner and stay there. Actually only one of the actors is visible at the corner, but the other actors have disappeared so I assume they are underneath . Hope someone can fix this problem.. I recall having this problem last time on my prototype table hockey app :P.gtg now so will check responses tomolo :)
  • SocksSocks London, UK.Member Posts: 12,822
    edited February 2013
    Hope someone can fix this problem.. will check responses tomolo
    The rules that are causing your actors to behave as they are behaving are on your computer screen in front of you - even with access to these rules, the ability to check them over, test and experiment with them, you - yourself - are unable to work out what is wrong - so imagine how difficult it would be for someone who can't see your rules to work out why they're not working.

    Imagine this:

    "I've just done a complex calculation and was expecting the result to be 147.8 but instead I just get 89.337 . . . hope someone can fix this for me, I'll check in for your answers tomorrow".

    Now imagine how much easier it would be if this person simply supplied the actual calculation and not just a description of the error it produced.


    ;)
Sign In or Register to comment.