Frisbee mini project

Heya there, first post here.

I’ve been toying with the editor for a week now and i’d like to move on to a mini project. I’d like to build an ultimate frisbee minigame.
I know frisbee physics is pretty complex (Bernoulli’s principle, etc…) and i’m pretty sure it’s impossible to get it working with PhysX but i’d like something that gets a bit close to that : being able to dictate a behaviour if the spin is low, lowering the spin as it moves forward, make it float (damping i guess) and all.

Now i’m looking for some hints and caveats that this community would have to provide for such project.

I’m not sure VR is a variable that needs to be taken into account here but that’s what i’m doing.

Thanks for reading and your replies fellows :wink:

What I would do is have an actor with projectile movement, and depending on the spin on the mesh, set the gravity scale of the projectile movement, the higher the spin, the lower the gravity. Based on the spin, you can add random side to side movements to make the frisbee act more realistic. Also based on the side to side rotation, you could increase gravity, and add movement in the direction it is leaning. If you need I can make a basic actor, and send the code your way if you need.

Thx for your reply. I’m still a bit newb so i’ll be asking a few questions =)

Are we talking about angular velocity here or is it something else ?

I don’t see a gravity intensity, only the object’s weight, is that what you’re talking about ?

That would actually be great if you can =). I won’t copy and paste stupidly as I need to understand the whys and the hows but that will give me some elements to check out and learn from that =)

Ok. I played around with the projectile component in the blueprint and found the gravity scale, managed to give it a realitic flight. The only problem I have so far is that when I can’t seem to give the projectile a consistence after it’s fired. It flies through walls and floors. I’ve tried to enable physics simulation which fixes that but then the projectile just falls in front of me when i fire it, and the console pops me error telling me that it’s incompatible with collision, i’m missing something but not sure what, if you have any clues =)

Other than that, next step would be to add conditional force depending on the rotation status of the disc. the more angle, the more gravity, and add some force as well to create a curl effect depending on the rotation aswell. I may need some gates that I don’t know yet :stuck_out_tongue: tips welcome on that too !

Hello, I would not use the projectile movement component AND physics simulation. Use either projectile movement component and self programmed physics or physics simulation. There is basically a non-physics system and a physics-system in the engine included and they both don’t work very well together. If you want to use physics simulation, you will have to deal with some problems like double collisions - physics simulation looks nice but is sometimes inaccurate meaning that for example you lose sometimes impulse even after a 100% elastic collision.
Topics for physics simulations would be: physics thruster component, physical materials, the physics API Physics | Unreal Engine Documentation (for example AddAngularImpulse).

For the issue with incompatible collision: I think you need to enable physics collision.

Thank you for the advice for not mixing projectile movement component and physics simulation, I won’t do it =)

enabling the collision as you mention doesn’t seem to do any difference though. I might have missed something.

Here are screenshots of both my sphere collider and staticmesh default specs (before I switch collision presets to custom and tick block everything as you mention)

I also don’t seem to be able to add force to the projectile (i’d like to give it a curl effect depending on the angle), is that possible ?

If you want to add impulse to the collision object (frisbee collision), it must simulate physics. Also, physics collision must be enabled on it. It works for me if I set the collision object to simulate physics and collision enabled (e.g. BlockAllDynamic) and the static mesh to NoCollision and not simulating physics.
I think if you want to use the collision object to check collisions, you should’nt apply physics operations to it’s child as the child then flies away while the parent stays at the same location in the world. Very useful for questions like this is the function “DrawDebugCoordinateSystem”.
​​​​​​​

Ok, I figured out that there was a collision with my controller collision box (i’m on VR). I finally workaround it with a 0.1s delay before enabling the physics simulation. After that, it seems that gravity scale doesn’t apply anymore, but I found my way with add local force and it looks pretty great.

There are now 2 things i’m blocking on, i’d need to capture a power from input, say when i press a button, it starts a power gauge, and when i release, it gives me a value in millisecond that I can use as a parameter to my function, and then pass it to influence the projectile velocity. Would you know how to do that ?

Also, i’d like to add a condition on the transform rotation of the projectile. If the rotation on the Y axis is between $value and $value, then -> blabla. Know how I could do that ?

Finally, I can’t find the projectile’s disappearance parameters. The lifespan is already inifinite but it doesn’t stay in the world forever, when collision, it’s gone not long after. I’d like to customize that.

Anyways, thanks a lot for your help so far ! Hope to be able to return the favor one day :smiley:

Sorry for the late reply, but what you want to do, is make sure that your mesh (With your collision) is set as the root of that actor, otherwise it won’t collide, then in your projectile movement check should bounce. I will make a blank project, and make a basic actor, and zip it up, and post the link here, message me on discord at Capn C4ke#9414 if that would be a better form of communication for you.

The collision is alright now, i do have the sphere collider at the root of the actor.

I checked “should bounce” but it doesn’t change anything, and my projectile was already bouncing before that, maybe because of physics ?

i’ve discovered branches and how to compare different values (IF style) but i’m down to compare what i guess is a vector 3 (GetWorldRotation) if that’s the right tool to get the info i want, and I need to compare that to an integer or float. I’d say i’d need a way to extract a certain axis from the vector 3 and mb convert it to float or truncate to integer but I haven’t found how to do that.

Still can’t seem to find how to set this. Currently i’d say that my projectile lasts about 3s, doesn’t matter if there has been a collision or not. It might be a combination of several parameters that get me to 3s. It also seems to be shorter with a smaller collider (that I can’t explain) xD

i’ve tried playing around with GetInputKeyTimeDown but I don’t know how to use that to then change the projectile velocity or initial speed since the controller and projectile are 2 separe blueprints.

I did add you on discord to be able to chat around too :wink: