TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
Enemies Following an Actor Type?
Pages:
1
Enemies Following an Actor Type?
rbuckley25
Posts: 19
April 11, 2013, 07:23:39 am
I'm trying to get the enemies in my game to follow/chase my player... the catch is my player has multiple different actor types for the different weapons he can hold. I'm editing the "follow a target" behavior to fit what I'm looking for but I'm having some trouble making the "target actor" for my enemies change whenever my player changes weapons... Ideas?
dtrungle
Posts: 1938
April 11, 2013, 07:38:08 am
Whenever the player changes Actor Type, send a reference of that Actor to each enemy so that they have a new Actor to chase.
You can also modify it so that the Actor Type of the player doesn't change, only his Animation changes.
rbuckley25
Posts: 19
April 11, 2013, 09:43:46 am
Thanks for the response. I'll definitely consider combining all the Actor Types into one and just using a lot of animations. I'm also considering making a ghost actor that will mirror the movement of my player and act as target actor. I'm not too familiar with the other option you mentioned. Would you mind explaining what you mean by sending a reference of the actor to each enemy? Maybe provide an example of how this might look in the behavior editor? Thanks!
dtrungle
Posts: 1938
April 11, 2013, 10:00:50 am
For your follow target code, you need to provide an Actor instance to follow. This Actor instance can be set/get using appropriate blocks. You can search the forums as I remember seeing them before.
Check this article for set/get blocks.
http://www.stencyl.com/help/view/set-get-attributes-remotely/
rbuckley25
Posts: 19
April 11, 2013, 12:13:42 pm
ahhhh, that's the block I was looking for. thanks for your help!
Pages:
1