• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

need help with having objects stick to each other

A

Asis2013

Guest
So I'm moving my code from game maker 8 to studio, and the previous code i used allowed me to have the objects spawning at the top of the screen (fallers) stick with the object by the bottom which was catching it (catcher). The problem is that when it the fallers lands on the catcher, the fallers don't move with the catcher. in game maker 8 i used this code in the step event x = fallers.x + xxs; xxs was defined in a collision event with this code xxs = x - fallers.x; . the point of this was to return the relative position of the fallers. but now the fallers don't do anything when the catcher catches them. Can anyone tell me why the fallers position doesn't update in the step event like should?
Thanks!

Code:
//movment with self
if(Colieded_self == true){
    x = obj_fallers.x + xxs;
}

//movment with catcher
if(HasColided == true){
    x = obj_catcher.x + xx;
}
 
Last edited by a moderator:
R

Rosieu

Guest
Being a beginner I can't say why it wouldn't be updating, that certainly is strange! I am most likely wrong but it sounds like there could be a 'translation error' with shifting some of the events / code across from GM8. Without wanting to pry too much into your code / events, users here could possibly help you out if you posted the information for the event? It's basically like a little summary of what's going on with the event and it's really handy when debugging / looking for support with events. It's perfectly fine if you don't want to post it, but it could (emphasis on could) be as simple as an error that 'proof reading' by a third party may solve.

Other than that, I would say be careful of your use of solids (if you're using them) because they can totally bugger up collisions, especially when dealing with movement the way you have!

Sorry I can't be of more help! :)
 
A

Asis2013

Guest
I have never used forms like this before so i don't know how i would go about posting the event information, can you tell me how to? nvm i edited it the parts that say if(Colieded_self == true) is how im telling the set event that it has collided with something. i know i could use code but this is just how its dont. im using a makeshift hitbox that moves higher when a faller lands on top of the catcher or another faller, thats why thrers two x = obj.x + xx; if you dont understand what i mean plz ask.
 
Last edited by a moderator:
Top