Create a rolling ball controller (top-down like "Waves")? Example included.

I think what we’ve all been doing is just using the right click menu in a blank space to search for new nodes to add instead of the library panel. Context sensitive can be confusing when there’s no actual context yet, such as with a blank blueprint.

Also I managed to enforce a speed limit the other day. Basically after you add impulse, get the ball’s current velocity, run that vector through a clamp vector size, then plug that resulting vector into a Set Physics Linear Velocity to enforce the speed limit. Do this as the next event after Add Impulse.

I still need to figure out how to slow to a stop, been busy the last few days so I haven’t been able to work on this. I’ll post my results once I get somewhere.

Sounds good! Thanks!

Edit: I’ve noticed that using Set Physics Angular Velocity produces a result close to what we want, because the speed is capped and it comes to a stop correctly. However, I can’t figure out how to increase the speed, as it seems to ignore the strength variable.

Edit 2: Apparently adjusting the strength/speed variable does work, but only up to a certain point before it’s capped (which seems a little too slow).

Anyone know why Physics Angular Velocity can’t go past a certain value? It seems to be working almost perfectly, but the max speed I can get it to is still too slow. After that, no matter what value I put into it, it goes the same speed.

I’m not sure but I think you should use Physics Linear Velocity. I did a google search just to compare the two yesterday and though I don’t completely understand it, Angular seems to be better suited for rotations, which may be why you’re seeing a hard cap.

I managed to get a different implementation running using Character Movement instead. Removed most of the instructions from my Blueprint in the process, and it automatically handles braking now, though at the cost of it no longer ‘rolls’ the ball around, for which I’m going to have to figure out how to fake that animation. Overall I think this will be a better way to go because physics can get wonky in weird ways.

maybe you can just animate a simple ball in blender/maya/max for the directions needed and plug those in.

That wouldn’t really work. The ball has to rotate towards the direction it’s moving in. It can all be done with the scripting system quite easily, I’m just not familiar with what combination of functions I’d have to do for that. It’s only hard because as someone who’s not terribly great with math I have a hard time wrapping my head around all the vector calculations.

I feel like it really shouldn’t be this hard. The creator of Waves has some development videos that show the progress he made with his game, starting with the simple ball rolling mechanic. I really have a feeling he’s using physics for it too, it kinds seems like it when he rolls down the hill in this video:

Edit: According to the description in the second video, he was using Torque, but then switched to impulses on the second one (but I think he went back to Torque because when he was using Impulses it didn’t look right.)

I think I just figured it out. I’m using Saeris’ blueprint from page 2 of this thread, except it basically cuts off at add impulse. I set the strength to 5000 and then changed the physical property of the ball in the component menu, it’s actually fairly simple.

In the components of the blueprint, just go to Physics and click the little arrow, which un-tabs more options.

Then change the Angular Dampening to 0, and the Linear Dampening to 5.5 (numbers will vary depending on your setup obviously).

My results are almost perfect from this now.

Edit: Video of the results.

well look at you… GJ figuring it out… Nicely done.


Physics Angular Velocity seems to be clamped directly in the PhysX code itself.
If you read the comments for the setMaxAngularVelocity function in PxRigidDynamic.h it says the default is set to “7.0”.

I was able to edit the AddTorque function in BodyInstance.cpp and call the setMaxAngularVelocity function to set a new max value to “20” and found that it did raise the limit allowing faster rotation.

It would be much better if we could edit that value in the editor properties or something because 7 feels much too slow.
The good thing is we have the source code now to change it if we really need. :slight_smile:

I’ll probably just stick with Impulse. Now I just gotta figure out the aiming and shooting controls.

Good idea, we should totally expose that, I’ll try and get that done soon!

Awesome! Glad to see developers being active in the community like you, thanks.

Anyone know how to go about having a crosshair follow the cursor and have projectiles fire in that direction when clicking? I could probably figure out the projectile part, but I have no idea how I would do a crosshair.

The irony here being that in the release version of Waves I ended up faking all the rotation because it looked better than using physics.

I had a feeling! Actually really glad to see you post in this thread. Thanks for the awesome game man!

Haha, wow it’s cool to see you here! So what did you do, character movement + animated rotation?


I agree with darkpivot about how great it is to see the devs so active in the community. We really appreciate it!

I have many question hope to find the answers here :
-What is the type of blueprint u have been used in your game ?

  • how can I override the gamemode blueprint so I can get my ball’s camera view ?

EDIT: well, I figured out how to do so,

  • I think the blueprint type is Pawn so it can be overridden in gamemode options
  • That was dump :stuck_out_tongue: , Actually my camera was visible but only flat to the surface, thx to @darkpivot for pointing that out by un-ticking the “use controller view” property in the camera properties.

But I still have a problem with camera it self, it’s rotating with the invisible arrow and that’s wired even after changing the rotation of spring arm to Absolute rotation !

Post a picture of your blueprint’s component setup. You may have it set up wrong.

Hi everyone,
Max angular velocity has been exposed and should be in the upcoming release, thanks for bringing it up.