Switching Actor Types

yelmusleh

  • Posts: 26
Hi there,

I basically have 4 Actor Types, on the level there will be Actor 1, Actor 2, Actor 3, and Actor 4.

Upon clicking a power up (which I have built), I want the positions of Actor 1 and Actor 2 to be switched.

I would like the power up to also switch the positions of Actor 3 and Actor 4.

Essentially after the click of the power up, I want Actor 1 to take the place of Actor 2, and Actor 2 to take the place of Actor 1.

Likewise, Actor 3 will take the place of Actor 4 and Actor 4 will take the place of Actor 3.

How can I do this?

Photon

  • Posts: 2697
Let's assume you have these actors properly referenced and stored somewhere; correct me otherwise.

Make two number attributes (let's call them Switch_X and Switch_Y). Do the following:

Set Switch_X to x of Actor 1
Set x of Actor 1 to x of Actor 2
Set x of Actor 2 to Switch_X

Repeat for Y, and then do it again as necessary for the other actor pair (3 & 4).

NOTE: It appears you posted this in "Resolved Questions"?
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

yelmusleh

  • Posts: 26
I was looking through resolved questions before posting it. It was unintentional posting this question under "resolved questions".

I forgot to mention that there are multiples of each Actor, so there is more than one Actor 1, Actor 2, etc. on the screen during the game.

Sorry if this has caused a fault in your response.

I went ahead and created the attributes of Switch_X and Switch_Y.

I have posted what I have completed in the attachment.

Did I set this up right? and what should I do from here?


Photon

  • Posts: 2697
Well, from the looks of things, if you just want to "switch" all actor types to another actor type, it might make more sense just to spawn the "switch" actor on top of the other one and then kill the old one.
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!

yelmusleh

  • Posts: 26
This has been resolved.

Thanks for the help!