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 7404359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:14:41+00:00 2026-05-29T05:14:41+00:00

Hey guys i have a question here, How do i create a body that

  • 0

Hey guys i have a question here, How do i create a body that will not have physic function until i press it? i have this code in my init

CCSprite *tail = [CCSprite spriteWithFile:@"Ball.jpg"];
[self addChild:tail z:1];

b2BodyDef tailBodyDef;
tailBodyDef.type = b2_dynamicBody;
tailBodyDef.position.Set(100/PTM_RATIO, 100/PTM_RATIO);
tailBodyDef.userData = tail;
tailBody = world->CreateBody(&tailBodyDef);

b2CircleShape circle;
circle.m_radius = 26.0/PTM_RATIO;

b2FixtureDef tailShapeDef;
tailShapeDef.shape = &circle;
tailShapeDef.density = 1.0f;
tailShapeDef.friction = 0.2f;
tailShapeDef.restitution = 0.8f;
tailBody->CreateFixture(&tailShapeDef);

[self schedule: @selector(tick:)];

The ball will drop off the the edge of screen at the start of game, but thats not what i want. i want it to stay at the same position until i press it. is there anyway i could hold the object back until i give some input?

  • 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-29T05:14:42+00:00Added an answer on May 29, 2026 at 5:14 am

    Haven’t tried it but toggling the setActive property seems perfect.

    tailBody->setActive(NO);
    

    Check out the ‘activation’ section here: http://www.box2d.org/manual.html#_Toc258082973

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

Sidebar

Related Questions

Hey guys quick question, I have an add remove script that will add a
Hey guys I have one more question lol. I am using a script that
Hey guys quick question, I have an entry that I put in my database,
Hey guys quick question. I have a div that gets assigned a number to
Hey guys I have a quick question, I have a dialog box that has
Hey guys really quick question, I have a simple test that I was doing
Hey guys, (relatively, I believe) simple question here, I have a UITableViewController with its
Hey guys this is a followup to my previous question . I now have
Hey there, here is a question for you guys. I have so much times
Hey guys, I have a question about asp.net I have this table with checkbox

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.