Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Issues with particles and camera
Started by ctmartinez1992 Nov 03 2019 02:11 PM

3 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ctmartinez1992

[GLOBAL: userInfoPane.html]
ctmartinez1992
  • Observer

  • 2 posts
  • Corona SDK

I'm having some issues with the particle emitters and the camera (which is perspective). There doesn't seem to be much documentation so I'm having a bit of a hard time understanding why what I'm doing is wrong, but I'm clearly doing something wrong.

 

Sorry for the video quality and static sound, but here:

 

You can see that the particles are not following the camera, and I don't understand why.

local emitterParams = json.decode(emitterData)
emitter = display.newEmitter(emitterParams)
emitter.x = event.other.x
emitter.y = event.other.y
emitter:start()
camera:add(emitter, 1)

https://github.com/ctmartinez1992/PachinkoRPG You can see the whole code here, I'm still pretty new to corona. I'm enjoying it, but I'm stumped on this one. I had no problems otherwise with the camera or the particles, but I don't understand why I can't just do this.

 

What I intend is that the particles stay on that lil barrel, but they are clearly fixed in a point in the camera.

 

Thanks for the help.



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 981 posts
  • Corona SDK

You need to insert the emitter to a display group to have it (and its particles) move with the rest of the group, e.g. group:insert( emitter ).

 

That perspective is a third party library and I am not familiar with it.



[TOPIC: post.html]
#3

ctmartinez1992

[GLOBAL: userInfoPane.html]
ctmartinez1992
  • Observer

  • 2 posts
  • Corona SDK

Thank you for your answer.

 

Ok, I think I have already tried something like that, but tonight when I'm at home, I will try it again and post feedback.

 

However, can you suggest me a better camera plugin. I confess that I like this perspective one, I have had no issue right until this point. Where I just can't get emitters to obey the camera.



[TOPIC: post.html]
#4

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 981 posts
  • Corona SDK

I've always just written my own "camera" functions when I've needed them, so I can't recommend or comment on them. If that works for you and you like it, then keep on using it.




[topic_controls]
[/topic_controls]