(URGENT)Creating a sequence for setDynamic(true) to setDynamic(false)

(URGENT)Creating a sequence for setDynamic(true) to setDynamic(false)
0

#21

from the beginning, doing a set disabled sequence which runs for 0.002 seconds seems like the safest bet. Does it seem realistic? The ball would spawn as though it was new right?

I will just use this. The problem is, when I set a dynamic action in the method. I get:


#22

I haven’t looked but what did test 7 and 15 show you? It seems like 15 should be close.


#23

I need to initiate a sudden stop. I sadly do not see an example of this. All achieved in 15 is good and I’ve achieved it already. It’s why the ball doesn’t collide with slingdot. Did you see the video? Is my issue unclear?


#24

Did you notice your typo?

PhysicsBBody?


#25

heh sorry for any confusion. In the example code, to make it easier I renamed the physicsBBody as
physicsbody . PhysicsBBody is short for physicsballbody and has always been it’s name in the actual code :slight_smile: proof? Take a look at the joint code in my last big code post :wink:


#26

otherwise I think the most likely way to fix it is to make a sequence in which:

1.set variables for a set dynamic true action and a set dynamic false action
2.run them in a sequence
3.->runaction the sequence to the ball sprite

step 1 and 2 i need help with, however. How do you set those as variables? In an auto code. I’ve never done this before and my numerous attempts haven’t worked


#27

@dimon4eg can I tag you in. Do you understand this? What I think the problem is and what is being described seem different though. Can you help understand?


#28

Shall I pm you my skype for a quick screenshare? (I would be on mute and talk via text though)


#29

maybe this loop will help (the moment the second ball collides with the floor i want it to spawn like the first ball (minus the little menu and 4 ball prompt)) http://www.infinitelooper.com/?v=3_Gh6nCAwlE&p=n#/9;14


#30

I don’t really understand because I’m not using any physics engine.


#31

so is this too hard to solve or too hard to understand?


#32

why not destroy the object and recreate it?


#33

Or setvisible(false) reposition, reset variables. Show it. Go.

I thought that would work originally but @Rascake is learning Physics.


#34

Because i would have to do the whole method again, because i must give the new ball a collision sound and an anti overlap method.


#35

What do you mean? Remove child or physics material?


#36

if you mean’t physicsBody->resetForces();
then I’m afraid it didn’t change anything


#37

well then not recreate the sound and the “anti overlap method”. It will not affect your games performance.


#38

it makes the game more realistic. this is for a competition and nice little additions add points

in short is it impossible to do this in the method?


#39

I dont understand what you goal is.

It is not impossible at all (anything).


#40

this is my point! Slackmoehrle is trying to convince me to switch to classes. When the solution can be done right in the method.