PDA

View Full Version : Making a car move forward



rlmergeuser
04-24-2012, 04:29 AM
Sorry if this has already been asked, I checked through the threads and couldn't see about this though. I wanted to add a monster truck to my level that can be controlled by the player.

I added coordinates and an object position event to snap a directional force to the center of the monster truck, and added a Gas Controller Value + operator with a value of 20'000 multiply, the car moves when I press R but it sometimes stops abruptly. Any help on how to get it moving properly would be much appreciated!

rlmergeuser
04-27-2012, 06:38 PM
I have had this exact same issue. I started to build a monster truck from scratch, then realized there is already one in the examples. Great. Using that I set up controls, turned the pivots into motors, etc. It moves, but after about 10 or so car-lengths, it stops abruptly and flips over, as if held in place by some component I've left behind. All the events/filters/triggers stay at my initial spawn location. I am wondering if, once they're outside the physics bubble, they stop working?

Did you ever find a fix for this?

uplay_n2dz
04-27-2012, 11:07 PM
I have had this exact same issue. I started to build a monster truck from scratch, then realized there is already one in the examples. Great. Using that I set up controls, turned the pivots into motors, etc. It moves, but after about 10 or so car-lengths, it stops abruptly and flips over, as if held in place by some component I've left behind. All the events/filters/triggers stay at my initial spawn location. I am wondering if, once they're outside the physics bubble, they stop working?

Did you ever find a fix for this?

You have to select your bubble physics area square (small red square near the bike) and set it to "follow your truck" under properties; I think is "follow target/object", target will be your truck. Otherwise physics will fail when truck gets outside the physics bubble... area.

Humm, hope you got it right... I'm trying my best to explain many confusing things...

rlmergeuser
04-28-2012, 01:48 AM
I was under the impression that you can't set that manually and that it automatically adjusts to your game-character's position. I've set my custom game character object. I think the problem is using "snap to driving line". I want it to follow the drive line, but it seems to have problems if anything tracks (or tries to track) outside that line.

rlmergeuser
04-28-2012, 11:42 AM
Use the angular motor setting on the physics joint the same way you used the force, much better way to move a vehicle, check out my rock crawler, all done with physics joints. I don't know if it will fix the driving line issue but who needs a driving line when your behind the wheel of of a monster truck

rlmergeuser
04-30-2012, 11:35 AM
I had the same problem, as far as I could figure it out, the truck has to be bang in the center of the driving line, otherwise it will slowly move away from it, then the "lock to driving line" option will kick into play and move it back, thus stopping the truck in it's tracks.
The same happens with other objects when they are set to stay on the driving line but aren't exactly central.

I also suspect you can't use any spline points along the map either, as this (in theory) would cause the same issue.

Can I ask, have you set it so that the truck can lean? If so, how have you achieved this? I got it working with forces at 45 degree angles from the centre, it works well on the ground but starts making the truck (Or other object http://forum.redlynx.com/forum/images/smilies/icon_rolleyes.gif ) acting strangely in the air.

Hope I helped at least a little... http://forum.redlynx.com/forum/images/smilies/icon/confused.gif

rlmergeuser
04-30-2012, 11:59 PM
I've set up the monster truck with angular rotation motors on the wheels, controlled by the triggers, and for now, a directional force in front of the truck to push +/- a certain value to turn it, using the left stick.

That all works fine, but just as the OP, it keeps stopping abruptly, as if crashing in an invisible object, however it doesn't seem to be due to distance from the driving line or anything like that. I've set up the physics bubble to follow the truck. When i crash into an invisible object, i can tuurn the truck a little bit, and drive around the obstacle, or simply try hitting the gas in some cases, and be let through.

I can drive all over the map, as far away from the original location as I want, I just keep hitting invisible objects, seemingly more often in areas that have objects like street lights etc in the vicinity.

To see for yourself, check the map "Keep Trucking" by Snjo. Any input on how to eliminate the possible bug would be appreciated.

rlmergeuser
10-10-2012, 02:24 AM
Thanks for the input! All been quite helpful.

As for the invisible wall/abrupt halts, I think that's happened to me before. It could be that when you release the R/A for gas, it sets the direction force or angular motor (whatever you use) to stop immediately. Or sets it's value to zero, the fix would be to make it stop gradually, if using set value events have them decrease when the button is released, something like that!
Sorry hard to explain when not using the editor first hand :b

rlmergeuser
10-10-2012, 09:35 AM
If you open up the track properties (the bit where you pick the bikes and change medal times etc) you can select something other than the bike as your game character. Once you've done this, the game automatically adjusts the default camera and the physics bubble to follow your new character, in this case, a monster truck.

Here's a tutorial for adding controls to a vehicle, if you don't want steering then just the section on the left will get your truck moving:

Vehicle controls using the angular motor (https://docs.google.com/drawings/d/1q44tfs1yB32gonnMHmDJO3heW7E-EQFUIMnAS1urQh4/edit)

There are loads more tutorials that might help with this (including some youtube vids for making a vehicle) in the Visual Tutorial thread at the top of this section of the forum, a full index can be found here:

Tutorial index (https://docs.google.com/spreadsheet/ccc?key=0Aoh--wDXoFOjdFhlZVF0bTgtUXZacHlnSUhsV0ZWZUE#gid=0)