Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Quad, M_D), 1,217 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
c_move friction problem with ball and platform #271154
06/11/09 15:38
06/11/09 15:38
Joined: Nov 2003
Posts: 433
The Netherlands
T
Toon Offline OP
Senior Member
Toon  Offline OP
Senior Member
T

Joined: Nov 2003
Posts: 433
The Netherlands
Is it possible to move a ball over a platfrom in a smooth way? The ball has gravity applyed.

I tryed the code below but it does not run smoothly. It looks like there is a problem with friction between the two models.

Here is my script;

Code:
 
action ball
{
	var ball_move[3];
	
	var ball_gravity;
	
	wait(1);
	
	c_setminmax(me);
	
	while(1)
	{		
		ball_move.x = (key_d - key_a) * 5 * time;
		
		if(trace_hit)
		{
			ball_gravity = 0;
		}
		else
		{
			ball_gravity = -5;
		}
		
		c_move(me,ball_move.x,vector(0,0,ball_gravity*time),glide | ignore_passable);
		
		wait(1);
	}
}

action platform
{
	wait(1);
	
	c_setminmax(me);
}


Last edited by Toon; 06/12/09 15:06.
Re: c_move friction problem with ball and platform [Re: Toon] #271436
06/13/09 05:57
06/13/09 05:57
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
You could try to apply gravity only when
the ball is stop moving.

Re: c_move friction problem with ball and platform [Re: vlau] #272136
06/16/09 17:08
06/16/09 17:08
Joined: Nov 2003
Posts: 433
The Netherlands
T
Toon Offline OP
Senior Member
Toon  Offline OP
Senior Member
T

Joined: Nov 2003
Posts: 433
The Netherlands
Thanks for your reaction, i didnt thought of that yet so im going to try it right now smile

Re: c_move friction problem with ball and platform [Re: Toon] #272137
06/16/09 17:17
06/16/09 17:17
Joined: Nov 2003
Posts: 433
The Netherlands
T
Toon Offline OP
Senior Member
Toon  Offline OP
Senior Member
T

Joined: Nov 2003
Posts: 433
The Netherlands
I tryed this but now the ball only comes down when i'm not moving it, so even when it is not on a platform but thanks for your reply anyway smile

Re: c_move friction problem with ball and platform [Re: Toon] #272139
06/16/09 17:37
06/16/09 17:37
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
From the online manual:
http://www.conitec.net/beta/ac_move.htm
Quote:
!! A usual beginner's mistake is extending the entities' bounding box all the way to its feet and then apply gravity for pressing the entity against the ground. This is not only slow due to the permanent collisions with the ground, it will also cause the entity to get stuck in any little crack in the floor, and prevent it from ascending stairs or slopes. Rather, use c_trace for keeping the entities' bounding box at a distance from the ground, and apply gravity only above that distance. See the example below for a simple movement function.


Re: c_move friction problem with ball and platform [Re: Pappenheimer] #272257
06/17/09 06:37
06/17/09 06:37
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
I'm not sure what you're trying to do, you don't need
to change the value of "ball_gravity" every frame, the
ball model will glide on the ground automatically and
it still move smoothly when it land as I tested with my
latest A7.com

I see that you're still using "time" not "time_step", it may
be the problem of c_move in old A6 version.

Maybe you could try move_friction :

Code:
while(1)
{
    ball_move.x = (key_d - key_a) * 5 * time;
    move_friction = 0;
    c_move(....blah..blah)
    wait(1);
}



Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1