Spawn an actor and make it stick to another
mxs2649
Member Posts: 32
Hi,
I am making an actor jump on platforms which are randomly spawned and moving, Each platform has a invisible actor just on the top side so that when actor jumps on top it basically collides with that invisible actor and the score is incremented by one, I am spawning the invisible actor above the platforms but how do i constrain its value to the respective platform? Like the spawned invisible actor just stays at its spawned location and my platforms are moving. How do i make it move along with them, as each platform is moving randomly and there is only one spawner to spawn the invisible actors. Any ideas?
Thanks in advance
Mukul
Comments
Help anyone? I have been asking a couple of questions here and no one seems to help..please anyone?
Why not just place the collide behavior inside the spawned platforms and collide with the platforms instead of constraining a invisible actor to the platform and collide with it. I think that would be better.
Agree. I don't think you need the invisible actor to score. Just add the score each time the actor hit the platform. But if you still want to stick the actor to the moving platform then just constraint the actor x,y position to platform x,y position.
My Gamesalad Games On App Store:
Greedy Chubby: https://itunes.apple.com/us/app/greedy-chubby/id834371213?ls=1
@mc99093 and @AlkaPP I know what you mean but then even if the actor hits the bottom of platform the score will increment, i only want to increment it if he jumps and stands on the platform. That is why i needed the invisible actor which is only on top of the platform..and all my platforms are randomly moving and there is only one spawner for invisible actor so how should i actually constrain the value, i mean there are 4-5 platforms on the screen at a time. Thanks so much for your replies.
Make TWO conditions, the platform collides with the actor, and its Y position is lower than the actor's. So you only score when you colide AND are on top of the platform..
Hmmm...ok that can be tried...thanks a lot @Chechesoft, Can you tell me how to then make the actor move along with the platform? it is the same thing as constraining. But again there are so many platforms, Once the actor is standing on the platform, it should move along with that one.
I havent tryed yet, it seems at first youll need some constraints.
Create a game attribute called "x movement". Then make a rule on the platform, something like when actor touching and on top (with the rules I suggested earlier), constrain the game atribute "x movement" with platform x position. Now every time the actor is standing over a platform the game atribute you made will be the same as the platform x position.
Now, on the actor create a rule that when standing over the platform constrain its x posotion with your game attribute "x movement".
Sorry if it sounds a little confusing, as my english is not as good as it should be.