Positioning object along other object - normal

Hi everyone

I am trying to make this cube move along this plattform (along the red arrow, which is just there for showing the movement, its not a steering path ), but it doesnt work somehow. And yh… the code i wrote there seems useless, so dont mind it.

wheelproto.blend (480 KB)

I want that this object always moves on y axis, and everytime it touchs the wall, it will climb on that, or even climbing down if it stands higher/ climbing up and down a ramp. Ground and Wall should have the same property (Ground). Its best if the object takes the object it stands on as “ground”, i guess it has things to do with force field constraint?
It will be a bunch of obstacles placed in the game and that cube should beable to climb on all of them.
Thanks for your help


This is a bit odd but it works :smiley:

Attachments

RockyRoller.blend (479 KB)

thanks blueprintrandom. but it seems not working very fluently. I want it to just ignore the gravity and roll along that ground. Is it possible?

Set gravity in the world to 0?

Unless you want other object affected by gravity, then I dunno.

I have to use 75.0 gravity in my game. its impossible. I still want the object to be able to fall, and touch other object.

You can set gravity to zero and use ray in -Z axis to test bottom of your car and if obstacle there than stop falling, elseway apply 9.8 force in -Z. You can even make the ray to be ~1.5 units and apply something like 5.0 force in +Z for exact frames(use timer) when it just activates so that he lands smoothly…

I cancle out gravity using a logic brick

always ----and-------applyForce(0,0,9.8*3) world

I’ll adapt this to 75 gravity units

Attachments

RollerBob.blend (490 KB)

tada - file is done

has health as well, if health is lower than 1 -> remove rollerbob

Attachments

RollerBob.blend (492 KB)

thanks blueprintrandom, it looks impressive. however i will see if i can reduce some of the logic bricks into python. hm. i dont know how to use realtime constraint like you did there. Hm if the object is spawned by an empty, will it still be constrainted? And, which of the object there is the main one? Since i see there is a chain between them, but none of them is the parent of one other.

just group it, and add a group instance to the hidden layer, and spawn that.

also if you removed all the actuators and used 1 python script,
it may be faster, but its logic use now is from the raycasts,
not from the actuators.

its not really using alot of logic anyway.
.05 ms on my comp I think.

I just thought of a new solution I may try tonight though.

Ok, my new way works alot better :smiley:

if your using 75 gravity you will need to adjust the

always ----and------Force

in the object ‘Player’

it’s 9.8 now, it will be 75

Attachments

BPRUniversalGravityForMapMaking.blend (769 KB)

woaaa genius!~ thanks BluePrintRandom

awe shucks, :smiley:

hm i am abit confused. i want the objecct to slide faster. which value should i change o.o?


if own.localLinearVelocity.y<(MaxSpeed):
    own.applyForce((0,Force,0),1)
    # and to prevent escape velocity
    own.localLinearVelocity.z*=.5

its like servo motion, but the speed is relative to the object