smashthewindow Posted July 21, 2012 Share Posted July 21, 2012 Check out the link I posted above. (Sorry, I think forum upgraded to only allow videos in the "Videos" section.) Right now, I'm using the code below to move the floor(Which is nothing but a small box made in Blender): [/size] [size=4]LE::TVec3 vel = LE::CalcBodyVelocity( platform, destination ) / timeInterval;[/size] [size=4]LE::SetBodyVelocity( moveTarget, vel );[/size] [size=4]LE::TVec3 omega = LE::CalcBodyOmega( platform, LE::Vec3(0) ) * 100.0f;[/size] [size=4]LE::SetBodyOmega( platform, omega );[/size][size=4] As you see in the video, the character just slides off the moving floor (even on ridiculous high frictions.). Can I get some advice on how someone would create an elevator? I've been able to get past this for Round & Round by just making the elevator part a cutscene when the ball gets on it, but I won't be able to do the same for a game I'm prototyping. Thanks for reading. Quote Blog & Portfolio Current project: moon.chase.star Link to comment Share on other sites More sharing options...
Rick Posted July 21, 2012 Share Posted July 21, 2012 I made a moving platform before. I believe what I did was use a body just for calling MoveEntity() on. Then I made a joint between the this body and the model that is the elevator. MoveEntity() will kill physics but because it's on the body it didn't matter because the player stands on the model, but because there is a joint the model will move (with physics) with the body. The nice thing about this is you can be very precise in movement because you are avoiding forces and can use functions like PositionEntity() or MoveEntity(). Quote Link to comment Share on other sites More sharing options...
smashthewindow Posted July 21, 2012 Author Share Posted July 21, 2012 I made a moving platform before. I believe what I did was use a body just for calling MoveEntity() on. Then I made a joint between the this body and the model that is the elevator. MoveEntity() will kill physics but because it's on the body it didn't matter because the player stands on the model, but because there is a joint the model will move (with physics) with the body. The nice thing about this is you can be very precise in movement because you are avoiding forces and can use functions like PositionEntity() or MoveEntity(). Wouldn't the joint limit player movement on the elevator? EDIT: I misread your post. Understood. Thanks EDIT2: But the thing with that is that you wouldn't be able to move while on the elevator right? Nevermind, you're a genius. EDIT3: Will the player still be intact even when the elevator moves sideways like I'm doing in the video? Quote Blog & Portfolio Current project: moon.chase.star Link to comment Share on other sites More sharing options...
Rick Posted July 21, 2012 Share Posted July 21, 2012 Not a genius, just handing off information that was once told to me . I believe Josh or someone else provided me with this information years back but I remember it working and loving it because it gave great control to moving platforms. Hope it works out for you! Note that it acts like in real life. If your platform is moving really fast then suddenly stops your player will keep moving in that direction so either keep things slow, or slow down before stopping if you're going fast. 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted July 21, 2012 Share Posted July 21, 2012 There is code in the engine that specifically handles the case you are showing and adds velocity to the character. Not sure why it's not working in your video. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
cassius Posted July 21, 2012 Share Posted July 21, 2012 I once did an elevator which moved up inside an elevator shaft using moveentity and nothing else.The character ( first person) moved up with it but I never figured how to make it stop in exactly the right place so the doors could open and the character step out. Does not matter now as I am doing a medieval game. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Josh Posted July 21, 2012 Share Posted July 21, 2012 If the platform is moving with physics and has a velocity, that velocity should be transferred to the character. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
smashthewindow Posted July 22, 2012 Author Share Posted July 22, 2012 If the platform is moving with physics and has a velocity, that velocity should be transferred to the character. Hmm, that's really weird. Did you test it? I've ran several tests after the video but all of them seemed to show an error. Quote Blog & Portfolio Current project: moon.chase.star Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.