Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7702425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:13:27+00:00 2026-05-31T23:13:27+00:00

I seemed to have run into a strange problem with the CCParticleSystem and the

  • 0

I seemed to have run into a strange problem with the CCParticleSystem and the iPhone.

I have a laser that is being shot across the screen from left to right. I added a particle effect to give the laser more of a railgun look to it. I used the “emmas sharing” particle effect from Particle Designer.

Here is the code to send the laser across the screen:

-(void)fireLaserCannonAddon
{
    if( _ship == nil || _ship.dead ) return;
    CGSize winSize = [CCDirector sharedDirector].winSize;
    shipLaserCannon = [_laserCannonArray nextSprite];
    [shipLaserCannon stopAllActions];
    shipLaserCannon.position = ccpAdd(_ship.position, ccp(shipLaserCannon.contentSize.width / 2, -shipLaserCannon.contentSize.height));

    [shipLaserCannon revive];

    CCParticleSystemQuad *laserEffect = [_laserEffect nextParticleSystem];
    [laserEffect resetSystem];

    [shipLaserCannon runAction:[CCSequence actions:
                                [CCMoveBy actionWithDuration:0.5 position:ccp(winSize.width, 0)],
                                [CCCallFuncN actionWithTarget:self selector:@selector(invisNode:)],
                                [CCCallFunc actionWithTarget:self selector:@selector(endLaserEffects)], nil]];
}

And the code to set the particle system effect to the laser’s position:

-(void)updateLaserEffects:(ccTime)dt
{
    for( CCParticleSystemQuad *laserEffect in _laserEffect.array )
    {
        laserEffect.position = shipLaserCannon.position;
    }
}

-(void)endLaserEffects
{
    for( CCParticleSystemQuad *laserEffect in _laserEffect.array )
    {
        [laserEffect stopSystem];
    }
}

If you open up the “emmas sharing” effect in Particle Designer, the effect is the same as when you click and drag across the screen. This works perfectly on the iPad and iPad simulator, however on my iPhone 3GS / iPhone (SD and retina) simulator, the emitted particles seem to be “carried” with the laser. It’s not as identical as setting the PositionType to kCCPositionTypeGrouped (the emitted particles stay in that circle shape), but kind of a mix between it being kCCPositionTypeGrouped and kCCPositionTypeFree. The particles are emitting off the laser, but also being a dragged a bit behind the laser instead of staying where it was emitted like on the Particle Designer simulator and regular iPad. It looks as if the laser is creating its own layer with the particle effect on it with the “layer” lagging behind it.

I thought that maybe the laser was moving too fast, but even when slowed down, it had the same effect.

This “bug” also creates another small problem, since it’s being “carried” with the laser, when the laser is off the screen and then taken out, the remnants of the last emitting particles are visible on the bottom left of the screen, since I’m sure its because the emitted particles are still following the position.x of the laser (which it shouldn’t be doing, only the base of it is supposed to) and since the laser is gone, it defaults to it’s default set position. However, I do not have this problem on the iPad / iPad simulator.

BTW, this wasn’t just limited to only the “emma sharing” particle effect, it seems to do the same for all the other effects.

Has anyone else ever had similar issues with using CCParticleSystems on a moving object for the iPhone?

Any helpful input is greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:13:28+00:00Added an answer on May 31, 2026 at 11:13 pm

    OK, so after some messing around, I found out what was causing all this.

    I originally had the CCParticleSystem set to 1.0 (original scale) for the iPad and 0.5 for the iphone. I changed the scale for the iPhone to 1.0 and everything worked like it should..just a lot bigger, but it worked. I really didn’t want to have two different particle effects for the same effect just because of screen size, so I figured I’ll just scale up to 2.0 for the iPad while leaving 1.0 on the iPhone. Low and behold, now the iPad suffered the same weird looking effect as I did on the iPhone, but much more extreme.

    Looks like I don’t have much of a choice now, but to have two different files for the same effect, but I’m relieved I found out what was causing this and can save a few hairs from leaving prematurely.

    I think scaling an effect is fine as long as it’s not following an object dynamically, like in my case.

    I don’t know if this would be considered as a bug or not, since I’m sure it’s a math thing that cocos2d is using and scaling it affects it.

    TLDR::Scaling up/down a particle effect will cause this weird effect when it is following an object’s position. Don’t re-scale particle effects that are following an object’s position dynamically. If it’s just in one spot, then it’s fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I haven't seemed to run into a problem yet, but I'm trying to make
I am working on a project for work and have seemed to run into
I've run into a problem where the TargetUpdated event seemed like it would be
Have run into an issue that i am hoping somebody can help give me
I am creating pivot tables in VB.NET and have run into a problem I
It has always seemed strange to me that random.randint(a, b) would return an integer
I have a webapp saved to the iPhone homescreen, and I need to run
I'm playing around with Django's admin module, but I've seemed to run into a
I have the unfortunate task of having to import data from excel into a
I have a Flash AS3 application that uses FileReference.browse() to request a SWF from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.