Collide rules not always working
FirstDan
Member Posts: 208
Hi
Can someone help me out? I'm jumping through a platform and landing on top, sometimes it will collide correctly but other times my player will fall through it!
Advice would be greatly appreciated
Thanks
Dan
Can someone help me out? I'm jumping through a platform and landing on top, sometimes it will collide correctly but other times my player will fall through it!
Advice would be greatly appreciated
Thanks
Dan
Comments
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Rule
When
self.Position.X -( self.Size.Width /2)-( game.playerswidth /2)
self.Position.X +( self.Size.Width /2)+( game.playerswidth /2)
self.Position.Y +( self.Size.Height /2)+( game.PlayersHight /2)
Collide
End
When player collides with platform actor
Constrain self.motion.linear. X= 0 and the same for y...
Else
Change velocity
Cheers
Dan
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
game.playersX > self.Position.X -( self.Size.Width /2)-( game.playerswidth /2)
game.playersX < self.Position.X +( self.Size.Width /2)+( game.playerswidth /2)
game.playersY>=self.Position.Y +( self.Size.Height /2)+( game.PlayersHeight /2)
collide with player
Very confusing
Anyone out their to help?
Dan
fps are not very good. I will do a test model and see.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Platform rule:
If self.position y + (self.height/2) is less than hero.position y - (self.height/2 + 5)
Collide with Hero
The + 5 in the hero equation is just to give you some leeway incase the pixels slip lower than expected due to gravity.
I hope this method works for you, I'm going out now but I will be back later if you still need some help.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
bounce when colliding with tag "Collide w/player". It had been working fine, but suddenly while adding a main menu and pause menu, i played it, and my character was no longer bouncing off anything at all. The strange thing is that when I bring in a new instance of lets say the actor that functions as the ground, it collides fine with that. Its the same actor as the ground actor that was already on the scene but the older instances dont work at all. The only way it starts working again is if i drag in new instances or i manually unlock the instances already on the scene and add a new bounce rule for that individual actor.
When you write a rule you can use the expression editor in the first instance.
So the best you can do is self.positionY (then is - greater / equal / less) -
How do you make a rule that does what you say below? Many thanks
This code was to let my hero land on the platform when falling down onto it but not collide when the hero is jumping up through it.
game.heroY > self.Position.Y >>>>>>> collide.
I have had issues with the player falling through the platform at times. Gamesalad is having to constrain my attribute all the time and then do a mathematical equation on top of that. I decided to simplify it greatly.
This is perfect for my game. But for some it might not be good having more actors. The platforms are also a pain to work with on stage so you do that manually through the scene inspector.
I have not fallen through my platform since - lets hope I don't! Cheers