123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|520|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> grinding?

Fri, 28 May 2010, 15:30
ShadowIce
how can i make an object follow the top of a grind pipe just like in the 1st 30 secs of this video?

https://www.youtube.com/watch?v=sY3BOgQJ8wE
Fri, 28 May 2010, 15:36
Jayenkai
The same way you make a player land on a floor, or a monkey grip onto a bar, or a fireman slide down a pipe, or a train cling to it's rail.

Best way, start with a straight bar, and make it work in 2D first, then expand with twists later.

-=-=-
''Load, Next List!''
Fri, 28 May 2010, 15:40
ShadowIce
um, i have NO idea what you just said.
Fri, 28 May 2010, 15:54
Cower
Do you have any ideas as to how you should do it? Did you try anything?
Fri, 28 May 2010, 16:01
ShadowIce
Well i tried aligntovector, but that didnt work
Fri, 28 May 2010, 16:05
Cower
I mean did you actually try to code it or are you just waiting for someone to write it for you?
Fri, 28 May 2010, 16:07
ShadowIce
um. no. we have been through this. i do NOT want ANYONE to write it for me.

if you want to see the code, here.

the code:


Fri, 28 May 2010, 16:59
Jayenkai
You need to stop thinking of the grind rails as an entity, or an object. The player will only hit an object. For floors, that's fine, but for grind rails it's different.

You can't slap down a model and go "Now do this" because the grind rail is much more than just floor.

Imagine the player jumps back onto the bottom of the grind rail. Using AlignToVector would snap the player's neck in half as he gets thrust down it instantly.. Don't do that!!

Instead, be sure to know where the objects are, where every point between it is, and then ignore the model. Do it in math(s) because doing it per-object is only going to make things trickier.

if player is near rail, make player lock to rail, make player velocity fall towards rail's direction.

-=-=-
''Load, Next List!''
Fri, 28 May 2010, 19:39
mindstorm8191
Cool video. Like Jay was saying, don't think of the rail as an entity you're trying to stick to. For the straight rails, consider the rail only a line, from point A to point B. If the player is 'on' that rail, then you should place the player's entity somewhere on that line, and move the player along that line. You may find yourself offsetting the line from the rail's entity based on the positioning of the player, but that's fine as long as it looks correct. This positioning offset would probably be a constant value. For curves, no matter which direction, you would have to come up with a calculation for your line.

Hope this helps! Remember, keep it simple...

-=-=-
Vesuvius web game
Sat, 29 May 2010, 06:56
ShadowIce
well how would i

"lock player on rail"

make the velocity

"fall towards player direction"?


Sat, 29 May 2010, 09:38
shroom_monk
Well, I would define a type of object called 'grindrail' or something, which contains two points in the world: the start point and the end point. Using some simple maths, you can then calculate any point on the line between those two points. If the player comes near that line, set some flag variables called 'lockedonrail' or something similar to be true. When that variable is true, move the player down the line towards the second point.

-=-=-
A mushroom a day keeps the doctor away...

Keep It Simple, Shroom!