[Resolved] mmm any help?

hi everybody

I am making a platform game but i have problems with moveable platforms.I know is a issue but any idea how to move the platform without these issues?any workaround?

this is the video of the issue, please take a look :slight_smile:

http://www.youtube.com/watch?v=TlEOaX1F3u8

I use a code i found here in the forum:the object has physics as STATIC

[code]local platform = suelo.plataforma1.object

local transLeft

local function transRight()
transition.to(platform, {time=2300, x=700, onComplete=transLeft})
end

transLeft = function()
transition.to(platform, {time=2300, x=900, onComplete=transRight})
end

transRight()[/code]

thanks to all
[import]uid: 177730 topic_id: 33429 reply_id: 333429[/import]

A look at this thread might prove useful, a few possible solutions are mentioned; http://developer.coronalabs.com/forum/2011/04/28/physics-engine-bodies-intersecting-falling-through-other-objects

Peach :slight_smile: [import]uid: 52491 topic_id: 33429 reply_id: 132781[/import]

thanks Peach, i will give a try but seems difficult to solve. [import]uid: 177730 topic_id: 33429 reply_id: 132789[/import]

well i think i found a way but anytime it collides with the object(platform) for example from down goes over it instantly.Is there a easy way to get on the platform only if the player jumps over?
The code i use is this:

[code] if (selfName==“hero” and otherName == “plataforma2”) then
if event.phase == “began” then
timer.performWithDelay(1, – 1 millisecond delay
function() – anonymous function to perform the update
suelo.hero.object.y = suelo.plataforma2.object.y -64 – this the high of player

end
, 15)[/code]

The video you can take a look
:slight_smile:

https://www.youtube.com/watch?v=an0vYNihhks
thanks
[import]uid: 177730 topic_id: 33429 reply_id: 132794[/import]

You have the function firing as soon as the collision begins - try adding a line to make sure the hero is above the platform. Eg;

[lua]if (selfName==“hero” and otherName == “plataforma2”) and suelo.hero.object.y < suelo.plataforma2.object.y then
if event.phase == “began” then
timer.performWithDelay(1, – 1 millisecond delay
function() – anonymous function to perform the update
suelo.hero.object.y = suelo.plataforma2.object.y -64 – this the high of player

end
, 15)[/lua] [import]uid: 52491 topic_id: 33429 reply_id: 132798[/import]

works perfect thanks peach [import]uid: 177730 topic_id: 33429 reply_id: 132805[/import]

If you’re working on a platform game, I might also suggest that you study my “one-sided platform” tutorial and example project, posted just yesterday. It might give you a new method to experiment with.

http://www.coronalabs.com/blog/2012/11/27/introducing-physics-event-contact/

Noticed also you’re testing with the character from “Braid”. What a great game! I enjoyed it immensely.

Brent [import]uid: 200026 topic_id: 33429 reply_id: 132887[/import]

Hi Brent, thank you very much .The tutorial is perfect for me because i was just thinking how to do a “passthru” platform and you came with the solution :slight_smile: [import]uid: 177730 topic_id: 33429 reply_id: 132898[/import]

A look at this thread might prove useful, a few possible solutions are mentioned; http://developer.coronalabs.com/forum/2011/04/28/physics-engine-bodies-intersecting-falling-through-other-objects

Peach :slight_smile: [import]uid: 52491 topic_id: 33429 reply_id: 132781[/import]

thanks Peach, i will give a try but seems difficult to solve. [import]uid: 177730 topic_id: 33429 reply_id: 132789[/import]

well i think i found a way but anytime it collides with the object(platform) for example from down goes over it instantly.Is there a easy way to get on the platform only if the player jumps over?
The code i use is this:

[code] if (selfName==“hero” and otherName == “plataforma2”) then
if event.phase == “began” then
timer.performWithDelay(1, – 1 millisecond delay
function() – anonymous function to perform the update
suelo.hero.object.y = suelo.plataforma2.object.y -64 – this the high of player

end
, 15)[/code]

The video you can take a look
:slight_smile:

https://www.youtube.com/watch?v=an0vYNihhks
thanks
[import]uid: 177730 topic_id: 33429 reply_id: 132794[/import]

You have the function firing as soon as the collision begins - try adding a line to make sure the hero is above the platform. Eg;

[lua]if (selfName==“hero” and otherName == “plataforma2”) and suelo.hero.object.y < suelo.plataforma2.object.y then
if event.phase == “began” then
timer.performWithDelay(1, – 1 millisecond delay
function() – anonymous function to perform the update
suelo.hero.object.y = suelo.plataforma2.object.y -64 – this the high of player

end
, 15)[/lua] [import]uid: 52491 topic_id: 33429 reply_id: 132798[/import]

works perfect thanks peach [import]uid: 177730 topic_id: 33429 reply_id: 132805[/import]

No worries, good luck with the rest of your project :slight_smile: [import]uid: 52491 topic_id: 33429 reply_id: 132973[/import]

If you’re working on a platform game, I might also suggest that you study my “one-sided platform” tutorial and example project, posted just yesterday. It might give you a new method to experiment with.

http://www.coronalabs.com/blog/2012/11/27/introducing-physics-event-contact/

Noticed also you’re testing with the character from “Braid”. What a great game! I enjoyed it immensely.

Brent [import]uid: 200026 topic_id: 33429 reply_id: 132887[/import]

Hi Brent, thank you very much .The tutorial is perfect for me because i was just thinking how to do a “passthru” platform and you came with the solution :slight_smile: [import]uid: 177730 topic_id: 33429 reply_id: 132898[/import]

No worries, good luck with the rest of your project :slight_smile: [import]uid: 52491 topic_id: 33429 reply_id: 132973[/import]