It seems wheels are only raycast wheels, any hope we could get some volumetric wheel colliders?
https://i.imgur.com/LcJ60rM.png
https://i.imgur.com/mA88WBE.png
#enfusion_physics
1 messages Β· Page 1 of 1 (latest)
Wheels are represented by raycast, yes. As for volumetric wheel colliders, I already have one working prototype but there are things that need to be solved first before introducing such feature.
<@&105623147411202048> Can we have threads here, please?
Sounds cool, I also would love to see volumetric wheels. The 1 flaw of the vehicle simulation currently (and it really is like the only flaw) is that torque is not directed downwards when you're crawling over obstacles because the wheels are just a raycast. Maybe colliders would help with that.
Also +1 to having threads here
shouldn't the raycast wheel be colliding with that object if it has collision?
there is only 1 ray cast from center of wheel downwards, which leads to unsatisfying and weird effects when colliding with small geometry. For terrain (rolling landscapes) its sufficient, but not for detailed interaction with other collision geometry. If the wheel touches with another part than the bottom most point, it just phases through until center is directly above it, and then the wheel pops up immediately
heres a description how physx handles it
https://docs.nvidia.com/gameworks/content/gameworkslibrary/physx/guide/Manual/Vehicles.html#wheel-contact-beyond-raycasts
This is how the raycast looks
So if it is only projecting a single ray downwards you will never be able to roll over things smoothly where the front of the tire could engage before the bottom (more raycasts or volumetric colliders allow you to climb over steeper objects and react better to small geometry)
This is a circle wheel collider ^^
I want this object to fall down if a car hits it. What should i do ?
per chance is the raycasting locked to one or is it possible to have say, two additional rays located a bit further out?
No way to modify any of that, its all in the engine source
why would they choose a inferior system?
what happens when you hit it right now?
it just disappears
huh, that's interesting
it has a collider and all right?
yes
I don't understand why would it disappear π¦
:/
is your entity set to static?
no
i mean in the entity not in the rigidbody parameters
where is it
flags
havent experienced this yet so not sure what's going on there π¦ sorry
if it's setup exactly the same like other props you can push around then it might be some bug :S
do you know any prop that falls down when you hit it
I remember the small military tents move around when I crash into them with a vehicle
{01AE5FD77A9A4C21}Prefabs/Structures/Military/Camps/TentSmallUS_01/TentSmallUS_01.et
this one
for example
so maybe try copying settings from it
also wooden crate should react quite nicely to vehicles
It worked!

I did the exact things and it worked.
What I just need was the "SCR_DestructionMultiphaseComponent"
Thanks man.

Is there anyway to decrease how forceful the physics engine resolves collisions? I've tried playing with the restitution value in my physics material with no luck, I actually haven't noticed a single difference between 0 and 1. (0 should be perfectly inelastic and 1 being perfectly elastic) Trying to create trains that behave realistically in how they realign the wheels to make a corner. It behaves as expected but with some caveats where it starts jumping vertically for what I assume is a collision resolution. https://www.youtube.com/watch?v=LIbnxpwQhps
I tried playing with my project physics iterations which helped only a very small amount, I maxed it out to 60 iterations in the video above. I've also tried a combination of 60 iterations and 240 ticks, no luck.
I've also tried playing with the different response indexes for different types of momentum but that hasn't helped either
are you really trying to make trains work in that fashion? or just meshing around ?
started out as messing around, if I can resolve the jumping then I'd like to make something more fleshed out using this method
I could always script a method to fake it, but it'd be pretty awesome to have it work true to life π
I've also tried a method with geometry blocks attached to a vehicle and have a similar issue with the collisions being wayy too strong and causing the car to just jerk back and forth and lose a ton of momentum. (disabled lateral friction as well so it wasn't a tire issue)
well to be honest I dont think you are ever gonna get a train to work using this method, I remember in gmod you can make trains like this but it was also rough to say the least. the guy who made the arma 3 mod for fast roping ,towing and what not made one for trains maybe you should ask him how its done.
I've done it in arma 3 π It definitely works, but only if you can tune the physics to allow it
I will look into scripted options though, not the end of the world to do it that way
I would only make the train react to physics of the track when it derails, otherwise just follow a spline
There is so much that can go wrong, I don't even know where to start.
The restitution: you can check if it works simply by just letting go a sphere on the ground from sufficient height and see how it bounces of with various settings. There is one unfortunate detail: if you change properties of physics material, you have to restart workbench for changes to take effect.
Jumping on the rails can be also caused simply by its geometry. How is it represented? Are all normal vectors correctly smoothed across the surface? The same applies to the "wheels" as well.
Also how far are you from world origin?
Nevertheless it is interesting test-case for physics engine π Will thing about it when testing features.
Ah I wasn't aware of needing to restart the workbench, that could explain why I didn't see any changes with restitution.
Normal vectors for each face are pointing radially outward from their respective face in this case, it is a cylinder with one end scaled down so normal vector will actually be pointing a bit outwards as well. I've also tried an "L" shape where the normal vector of the rail and train are directly opposite each other with no significant change in jumpiness.
I am near world origin, within 500m.
have you tried to make the cylinder more smooth in terms of vertex count, like to increase its "roundness". Other thing to try is making round corners on the rails just to help smooth out the collision handling.
I agree with others that this is far from ideal case of how to simulate train but from physics point of view there shouldn't be anything to prevent you to do such thing.
I have, rounded corners were more unstable in terms of lateral jerkiness
Vertex count hasn't helped either since the cylinder isn't actually rotating. The same face is always in contact with the rail
I agree as well, this is definitely not the ideal way to do it. But definitely should be doable, and more of a I want to do it sort of thing
Vertex count hasn't helped either since the cylinder isn't actually rotating.
And how are the wheels moving in the video then?
frictionless surface with force added to CG in local forward direction (+z)
The "wheels" aren't wheels at all. They are just there to guide the body back to the center of the track
They could be wedge shaped and do the same thing
ok that's weird, the guides should be rolling:
https://www.youtube.com/watch?v=vkzgcJGdUnA
have you tried it instead trying to force them to slide?
In this case rolling vs not rolling means nothing. In the real world rolling is what provides the ability to accelerate the entire body. In video game we can apply any fictitious force we want to achieve acceleration of the body. I will try it though.
If anything rolling may add even more vertical jumpiness, at least my intuition says so
Wow interesting, I stand corrected.
Rolling cylinder does WAY better with very little jumpiness. Changed my script to apply a torque instead as well
@high sparrow https://youtu.be/eKoMXcLJxb4
The winXP theme caught me off guard
omg I absolutely love it, recently tried to switch my pc to win xp sounds
why do vehicles go uphill faster in reverse?
reverse gear have quite often higher ratios than first gear
and on the other hand moving uphill forward seems to be much slower than it should
https://letting.ru/en/struzhka-v-korobke-peredach-uaz-buhanka-prichiny-vse-chto-neobhodimo/ UAZ-469 and UAZ-452 family has the following gear ratios: 1st gear - 4.124, II gear - 2.641, III gear - 1.58, IV gear - 1.00, reverse - 5.224.
higher gear ratio helps with going uphil
I just noticed that it may not be the car but not being able to go full throttle when driving it, because if I script it to go at max throttle it climbs nicely
but when I drive it I never get high RPMs in the lower gears, and eventually stall if it's very very steep
nvm all that, now it works fine, it seems it was all in my head, just stalled once because of a gear change, sorry
Hey, does anyone know a solution to prevent vdm?
vdm?
running over players with vehicles
just donβt run them over
facts
What if you put a big ball between instead of on the rails? Or two balls connected with an axle?
Is there some way to get the vehicle clutch to function like a real clutch instead of a game clutch? i.e. when the car is in gear and the engine ticking over the vehicle would forward without control input.
can we bind collision events to scripts? run a script on collision?
Mabye IEntity::EOnTouch?
IEntity::EOnContact, don't forget to enable the event in entity/component mask for your entity/component where you want to override this method π
What causes an object to fall through terrain? I've tried a ton of layer masks and presets without success. I can walk into the object and collide with it if I remove gravity, but if it has gravity it falls through the terrain
update: seems it doesnt like my triangle mesh for a collider. switched to a box collider and it worked
any clue how can I cancel a running trace move?
There is none that I can see. What are you hoping to solve by having this?
no reason to continue running the trace if it hits something I want
are explosion area effects just raycasts against firegeometry?
not sure I will take a look, many games I know use physics spheres to simulate explosions in games, but my guess is that bi have used the raycasts because it would be more realistic to real world explosions with shrapnel
Why do the "Destroy Spawn Objects" (from SCR_DestructionMultiPhaseComponent) not spawn in MP on a dynamic rigidbody entity?
Did not find id = 0x40000029 item = @"ENTITY:25" ('Tree','Assets/Vegetation/Tree/Pinus_Sylvestris/Dst/t_pinus_sylvestris_2f_dst_base.xob') at <95.311005 0.980000 137.380005> in Spatial Map at < 0; 0>
perhaps relevant https://feedback.bistudio.com/T165765
Yeah looks like the same bug
Hey there,
Is anyone aware of a method of locking/freezing an axis of a rigid body? Basically I want to force a rigidbody to always be upright
Why is my custom model not colliding with the terrain? Same layer as eg. a bottle (PropFireView) but only my model is falling through the ground π¦
does it have this?
yes, I even copied the bottle and just changed the mesh
What type of collider did you create for it? I've had issues with triangle mesh colliders not working sometimes for terrain collision, usually switching to a convex collider fixes my issues
UTM
Yeah, try something else like convex
UCX
In blender there is a button to automatically make a shape convex as well
I'm not sure if its a bug. I believe somewhere on the wiki it might say why, or it is a bug and I am wrong. I forgot π¦
check Physics::SetLinearFactor
Thanks!!
how do I make a shell bounce 
Thats honestly a great question, did you end up figuring it out?
I'm surprised theres no bounciness or restitution style parameters for rigidbodies
There are in the physics materials; butttt I haven't gotten it to work
no - the shell move component projectile disappears when it hits something, even with collision triggers removed, and regardless of what I put in deflection settings
projectiles currently support bouncing only from specific objects like terrain. Other than that it is not possible atm. It's partially missing feature and partially a bug.
ok, I'll just be patient for now, then, thanks
are some kind of rope physics planned for the future?
in the near future, no
fair
It works fine to me. E.g. I put down a sphere collider with 0.5 friction and 0.88 restitution (coefficients from studies of footballs), and I have a functioning football, can dribble it around a bit or throw it and it behaves in a remarkably realistic manner. Maybe you made the same mistake as me at first; the MPTest terrain is made of sand which has 0.05 restitution so things don't bounce on it. Also you must restart Workbench after changing physmat properties to see changes.
Ahhh, that must have been it. Definitely didn't check the MPTest terrain material
Damn I hate the way Enfusion handles ragdolls.
is there an explosion effect / damage type combo that can move vehicles but not move characters as much?
can a projectile produce the same effect that ramming something with a truck would?
physics wise
Good question also I think bullets are not manipulatable any more(were in arma 3)
With scripting you should be able to get the transform, just like ragdolls do, they push the body based on impact transform, but I think you may have to manually do this
afaik this is done in the C++ side
What about the OnDamage events for HitZones?
Isn't that a way to get hit position for vehicle?
Yes you can get the impact positions and normals like this via OnDamage. But not sure how you would go from there scripted
is anyone working on a Multi Raycast Wheel collider system ? the Single Raycast we have rn is so bad.
Could you elaborate? I would like to know more
how do I make EOnContact fire when colliding with things like buildings?
hope its just layer presets
... even though the thing does collide
just doesn't fire the event
is there a layer preset that collides with buildings + terrain + entities and allows me to have user actions?
its a grenade, and there is a layerpreset in the grenade move component
but... it doesnt fire my EOnContact
Do you mean like when a grenade hits a wall or the ground and makes a sound like *clink clank*
Do you have the event mask set for the entity u want the EOnContact to fire on?
SetEventMask(EntityEvent.CONTACT);
is dayz fully enfusion now?
no and wrong channel
Hello everyone, I just created an object (sewer) but while doing my test the navmesh does not want to enter my sewer (photo). compared to a vanilla house
you have navmesh generation controls
so you can tweak how close/far to/from walls it goes
also this is physics channel
I think for your sewer you can regenerate only relevant tiles with different settings?
walkable raidus work
can I mash multiple rigidbodies together with joints to make a horrible rope physics thing?
Mabybe with 6DOFSpring. If you read this implementation it's basically a chain of spring joints: http://nehe.gamedev.net/tutorial/rope_physics/17006/ . Alternatively maybe the engine exposes enough to implement in Enforce as described on that page.
OpenGL Tutorials, Demos, Games and More...
yes, like Steve-E said, you can use the Physics6DOFSpringJoint for it but I'm warning you, the stability and performance will be far from ideal.
I think I tried it once but it became gmod physics pretty quickly so will try it again sometime in the future
Hi, I know ARMA 3, and one aspect that is definitely problematic when using tanks is the immovable stone fences; in real life boulders are dangerous at high speed, however stone fences can be destroyed by a MBT, and is not believable it will full stop it from 70km/h. is there any plan to improve this?
I don't know how Arma Reforger would handle tanks as there aren't any
ah ty, good to know
but what I do know is that if your vehicle is heavy enough you can drive through some walls, including buildings
it's a great feeling when an enemy squad is defending a building and you just drive the back of your truck into it through the wall and attack them
any plan to add MBT in reforger?
didn't see any tracked vehicles in the roadmap
unfortunately the worst thing about 0.9.7 is you can't stack BTRs anymore
rip btr stacking
The only working tank is a sherman m4 and consideringing humvees dont, tanks shouldn't either
bummer xD
Do they actually float now? i know they used to but they've seemed to decide to stop actually working
the blackhawk mod broke their amphibious features, so they dont float if the mod is enabled
I seee, That makes sense actually. I hope it gets fixed it was a fun little thing to have in the arsenal when Gm'ing. Thank you bacon
is that still the case?
Can I use enfusion engine to create fixed wings?
In that you have a rigid body upon which you can apply forces and build a vehicle controller upon, yes. In that the engine helps you by simulating anything; no.
how do I stop my vehicle from slowing down rapidly when turning?
Turn less
@fleet zenith I've seen you got lost from kiddy land #reforger_xbox
Thatβs how physics work though
Maybe it has something to do with the differential ?
"Locked differentials will ensure both wheels on an axle always rotate at the same speed. This provides great grip but is not ideal for turns, where wheels are meant to rotate at different speeds."
Taken from the car creation guide
I think CharacterAnimationComponent::AddRagdollEffectorDamage should do it.
Dope. Also can I bounce them like a pinball machine using rigidbodies?
Are we able to revert back a character from ragdoll again? To achieve a temporary tazer effect?
I know you can set ragdoll to inactive but honestly haven't tried
Yes you can now, you can test it by enabling in debug menu (Character -> Enable ragdoll debug), and then use melee attack to toggle between ragdoll or not
There seems to be something happening to the ragdoll where after some time not moving it becomes inactive, is there a way to selectively extend or disable this timer?
In CharacterAnimationComponent you should have a property Ragdoll Disable Timer
Perfect, thanks
What would the script command be to disable ragdoll?
CharacterControllerComponent::SetUnconscious(false/true), should only be called on the owner though
There is no way to just activate the ragdoll, you need to go through unconscious state
owner and not authority?
I was able to activate ragdoll by creating it against a character entity and setting it to active
Though maybe I created a new one but it sure did work
Yes of course you can create your own ragdoll by using PhysicsRagdoll::CreateRagdoll but you will need to do the work yourself, I mean, matching bones position, synchronisation ect ect. But if you use CreateRagdoll function, you should be able to do it on any entity and not only characters
Yes owner for now ..
is ragdoll, grenade, vehicle the only thing with synchronized physics in multiplayer? as opposed to things like props
Hi i imported a fbx model one more time but this time the body isnt rigid and doesnt work when i put the rigid body component and configured that one like a rock of the map for example... idk why some help?
As a theoretical question; Is it possible to add artificial weight to vehicles ? So they're top-heavy and easily tip over ? I've just had an idea in my head recently that involves it.
You can change the weight by changing the mass of the vehicle's chassis via RigidBody API as well as changing it's inertia tensor. Other than that there is no support for dynamically changing weights on the body or adding some additional via another object if that's what you're asking for.
Oh I see, thank you! 
There is also a 'Center Of Mass' property on RigidBody component on vehicle prefab
Anyone implmeneted a motocycle in a game before? Thinking about how to stop the bike falling over and drive fun e.g. Apply torque on Y axis, or a weight-shifting control system.
in a3 it was typically done by making 4 wheels
personally I did setup with 6 wheels - 2 wheels very close to each other on front & rear axle + 2 small wheels in the middle of bike for proper weight balancing
I imagine you just put wheels on the sides like training wheels
Just give them a lot of suspension movement
some of the games and mods are also faking weight shifting/tilting by animating whole motorcycle with some proc animation
and usually this is the easiest solution
hmmm ok; will experiment with extra wheels and see if it's fun.
I wonder if it's possible just to recreate the real motorcycle with two wheels and hope it will self-stabilize it? π
I made it first with a sidecar; works great. but remove the sidecar and it falls over very easy.
Just tried with extra wheels and whilst it works, I'm not really satisfied with the result.
irl bike gets stabilization from the fact that front wheel is free to steer however it wishes
so I wonder if you can let it do so, or does it rather lock steering to the angle dictated by steering inputs
I'm going to go play some other games with Motocycles, get a feel for the handling and try and reason about how it works and why it's fun.
I can only remember cyberpunk and there it's unrealistic π he steers it like a car and doesn't lean at all π GTA V felt better in a way.
wut? you barely steer the wheel after a certain speed
its mostly leaning your body. its only when you are really slow do you actually make some meaningful steering inputs, probably the only exception to this is with a sidecar
yes, or did I say otherwise somewhere? π€
Unfortunately not, you would have to create completely custom controller along with simulation. Enfusion does not support single-track vehicles in any way rn.
Literally unplayable. PLS FIX. I think a fake two wheel works fine. Wasn't the bike done like it in arma 2 dayz mod? Those steered quite ok
The question was about real two wheeled vehicle with balancing so Β―_(γ)_/Β―
You can add some leaning etc via animations maybe. So physics is detached from what it looks like.
Maybe self-stabilization could be achieved by dynamically changing the location of center of mass depending on the rotation change by which side the bike is tilting.
But are two-wheeled vehicles completely out of the picture ? Will the engine liturally not let you import a vehicle if it doesn't have more than 4 tires ?
The built-in functionality supports only vehicles with two wheels per axle and 2 axles minimum rn if we are talking about existing simulation component (VehicleWheeledSimulation). It doesn't mean you can't script something completely custom.
Gotcha, thanks! 
Two wheels in the same position works like one wheel. e.g. with the sidecar is actually 6.
You can also do self stabilization by calculating the angular momentum vector for each wheel and applying it correctly, which should produce self stabilizing behavior. For leaning you then add another torque that you could scale appropriately with steering input
How would I go about slowing down the bullet speed and changing its velocity?
muzzle component in the weapon prefab, I think
is there some docs for destruction multi phase component?
also, when a vehicle is going at a high speed and an explosion happens under it, it doesn't take any damage, even though the damage speed is set to 0 which is instant, is this a bug?
when this happens I see this in the log and the vehicle takes 0 damage:
UpdateEntities
WORLD : PostFrame
WEAPON (D): Damage was precomputed
when the vehicle takes damage I see the individual hitzones in the log after the above line
I even see the trace lines with little red spheres at the end but no damage applied to vehicle
also I'm sorry if this is not the right channel for this
That's weird. Even if the speed wasn't instant they should still be taking damage anyways. The only thing I can think of is the damage reduction from the hitzones being too big. Thanks for the report.
Not yet.
if you'd like to test it, this happens when you drive over a "AT mine" from the Game Master FX mod at a relatively high speed, though now I've implemented a galaxy brain workaround where I force the vehicle to be on fire every time (still doesnt take damage, but at least the mine does something)
but when driven over at low speed then it has no problem sending the hummvee into space
here's a comparison, recorded in different places though (but I verified terrain surface angle and stuff doesn't matter), I added the set on fire thing after those tests
How can i make explosion center be upper?
is the charge's origin under the car?
no, its right in vehicle
is a client on a server aware of the angular velocity of a vehicle driven by someone else?
as in is that computed or is it passed to movement interpolation?
No, only linear velocity. Angular will/should always be 0.
thank you I guess this is why my hind turret stabilization script didn't work on a client π
Connecting 3 objects with a ball socket
Doing the same with fixed joint.
the inputs are the same for both classes, but the ballsocket is adding an offset for no apparent reason.
Fruit by the foot
Mmmmm rope physics
:D,
When I add a pocket to the vest, it sticks to the floor. What can I do
Not rigged properly for me
Or just the position set in the vest check the offset
I have adjusted the offsets but am I missing something in this right menu?
can you show your pouch prefab. Maybe you are missing something on that
Is the pouch skinned to the skeleton, if not, try picking the pivot ID as spine5 and see if it connects and moves properly.
If it is skinned and you imported the bones etc on it, you will need to share shots of your settings etc.
The game's own pocket model falls to the ground. It works normally, when I add a new slot or change the place with the start slot, it falls to the ground.
i didn't try this
Where / How is the projectile collision calculated? I see no rigidbody on them and EOnTouch/EOnContact is not being triggered by them or the entity they are colliding with π€
It's processed by DamageManagerComponent/HitZoneContainerComponent but I'm not sure how much access you will have in script.
Hmm there are only 2 components on the projectile InventoryItem and ShellMove. If the the DamageManager is included in the ShellMove its not accessible at all
maybe you could describe what are you trying to do?
Im trying to make a one way projectile collider. So one way it goes through and if it comes from the other way it will collide.
PhysicsBlock on the projectile and the collider is not working and its not registering the projectile hitting my collider in EOnTouch/EOnContact.
I guess you have the physics flags set already?
Yes, it works for vehicles
Maybe I can teleport the projectile to the other side before colliding or spawning a new one on the other side after colliding
It's what gets hit that has it
Ohh right, but if it doesn't have it the Projectile deletes itself before triggering Touch or Contact I guess.
So there is no way of manually stopping a projectile colliding then. You can only see the damage it dealt on a HitZone.
@tame sage
Few questions:
- Do vehicles not use the rigidbody class? Modifying "use gravity" has no effect (I remember this was working previously but for some reason is no longer working), and adding a force to the vehicle every simulation frame has no effect.
- What does Response Index change and how important is it to select a correct type?
hmm adding force did work for me with vehicles
while turning off gravity did nothing, setting mass to 0 did turn off gravity
hmm, wonder what I did wrong. I have a component and in onsimulate I add a force. it works for a regular rigidbody object, but not a vehicle
rb on vehicle might be inactive, need to activate it first
how reliable are projectile collisions at super high speeds? ie. projectile speed 10000
My experience is extremely unreliable
I added a check if the object is below terrain every frame then it collided and teleport it to the terrain height and explode it
is it possible to stop a door from opening with something that stay in front of it like a table or something like it?
players can definitely block doors from opening and closing, so based on that I'd say it possible to mod it in.
well if you move at the same time as the door opens the player will slide through the opening door
thankfully props dont usually move
and the prop dont colide with the door
I don't know if this has been reported but I think there's a game engine bug with prefabbed slots. I have a wing which extends my base vehicle in length, when I attach it to a slot, I can collide with it with my character, as I can walk on it, I can collide with other vehicles, but I can not collide with terrain or building objects. I drive through these as if my wing is not registering the colliders but everything else is.
You just have to have the collider on the base prefab
In the warhead prefab you can go to the base trigger component and modify the trigger offset value to change the origin of the explosion.
PHYSICS (W): *HUGE* collision test against terrain. Is it possible to disable this warning? HUGE collision tests against terrain is exactly what I want to be doing.
no, it is not possible to disable the warning
I was playing with multiple prefabs on a vehicle with their own collision the other day, and it seems like only the main meshobject collider of a vehicle can stop the vehicle from moving, is there something I did wrong? I attached some stuff in the slot manager component -- though the BTR turret also doesn't collide in a way that affects the vehicle
does applytorque work?
impulse torque and force appear to only work on rigid bodies, but I'm assuming they are similarly applied like in unreal engine?
no I mean regardless of what I put in applytorque, nothing happens to my rb
hence I'm asking if it works
This works for me:
class TorqueTestComponentClass: ScriptComponentClass {}
class TorqueTestComponent: ScriptComponent
{
[Attribute()]
vector m_Torque;
override void EOnInit(IEntity owner)
{
super.EOnInit(owner);
}
override void EOnSimulate(IEntity owner, float timeSlice)
{
super.EOnSimulate(owner, timeSlice);
owner.GetPhysics().ApplyTorque(m_Torque);
}
override void OnPostInit(IEntity owner)
{
super.OnPostInit(owner);
SetEventMask(owner, EntityEvent.INIT | EntityEvent.SIMULATE);
owner.SetFlags(EntityFlags.ACTIVE, true);
}
}```
maybe it doesn't work on a vehicle?
Yeah I did this on a vehicle and it doesnt have any visible effect
m_physics.ApplyTorque(vector.Forward * 10000);
I wonder if these are related
I was trying to add force to a vehicle the other day and couldnt get it to work
That torque test component I wrote yesterday I tested on a prop
applyimpulse works
that's why I'm confused
I need to use something like applytorque for my vehicle because if I use set angles then it breaks all collision
alternatively a way to retain collisions when using set velocity and set angles would also be pretty cool, without phasing into terrain and stuff (but it might be impossible since I am overriding velocity)
I also wonder if phasing into things is caused by a surface material of the collider and how I could set it up to bounce off of everything
Is there a material physics I can use to prevent water from coming though?
there's no water volume simulation so I don't think so
I spent like all day yesterday playing around with colliders and materials, should of just asked and got my answer π€£ Hopefully this gets added to the engine at some point, especially when official boats are out
If I Deactivate VehicleWheeledSimulation component, the vehicle looses gravity. Activating the component again, it does not regain gravity. π
π’
This actually worked for my use case, but then VehicleDamageManagerComponent gives divide by zero errors.
does xbox have like, more gravity or something? my controllable entity cant ascend on xbox but can on pc
Iβve notice some vehicles behave differently on Xbox than on pc
I made the mistake of applying physics forces in a way that depended on framerate, so with 30 fps / xbox was half as powerful as in my testing with 60 fps
The fallout way π
impulse * (timeSlice*59.4) fixes everything
*59.4, I love the specifics
yep, that magically brought all the things to how they worked when I tested them with 60 fps
of course initially I tried 60, then 59... but it was too high
ok next problem, collider is unreliable, can phase through terrain
Layer setting, but not sure which one
I can't phase through vehicles but can through terrain and buildings at high speed
so the collisions work for the last two cases but only at slow speed
I think this may be a bug, but I'm not sure
I had simialr experience
It also didn't happen 100% of the time, but definitely does happen A LOT
What colliders are you using
just a cylinder
example
note I am using applyimpulse to move the object
switched to UCX and seems better
now I need twice as much speed to phase through things
Can you enable CCD on it and test?
slightly better
Read the docs of EnableCCD method
and set your params accordingly
You can change the state at runtime as well
So in certain scenarios, certain settings might be better than others
oh I thought just making the sphere not 0 enables it
also, do the physical material settings work correctly? I wanted to try making the thing bouncy like a rubber ball
You have to restart workbench for them to take effect after a change
it appears setting restitution to 100 does not make me launch into the stratosphere, though
Maybe there is a cap at 1
perhaps, I kinda expected gmod physics to happen
I am using a front wing prefab slot which extends the vehicle so I need to use the physics from the wing as its destructible. I have manged to get a decent set up with the destruction, just one issue left, I cannot collide with terrain buildings/objects. I can even walk on the collider. Anything more I can do?
I think you would have to uncheck Disable physics in the slot where you have the wing but that just makes it collide with parent and parent will damage it
Yeah that's exactly what happens

Turns into a bouncing mess when I do that. I can add the collider for the front wing back into the main model but if the front wing is gone, the physics will still be there
There is a deactivate physics on attaching which is unchecked which should mean, the vehicle simple collider/Complex should interacted with the terrain
Just ran a test on the Ural with the slotted prefab for the canvas, that also does not collide with the terrain
Do you want it to interact with Terrain but not entities?
slotted entities dont interact with terrain
In the case of a slotted entity extending the length of the vehicle, you would have thought the physics set in the slot would apply. In this case, I want vehicle preset
what should I do to my rigidbody when I give and take ownership to/from a network client? I think gravity of the rigidbody being simulated in places that arent controlling it makes the movement jitter a bit when looking at it at a different client
@stone parcel so the vehicle its self interacts with the terrain, the slotted prefab does not even though this was given the vehicle layer
Look at the uaz wheels they are slotted
@true linden yeah thats a good shout , they use triangle mesh colliders and hitzone containercompact in the prefab. I will give that a go I guess
@remote flame Just attach one of the uaz wheels to your vehicle and see if it collides terrain
Well I have set it up and its doing the same thing @rustic harbor its working to a certain extent. I can sometimes lose the wing by crashing into the terrain that's good, but its still going through the wing. The wheel radius is set in the vehicle wheeled sim so I am sure thats what is giving it the physics and not the actual set up in the prefab. You would have thought adding the vehicle layer in a collider should be enough for even a slotted entity to apply the correct physics.
The problem seems to be that you cant disable physics only vs parent but keep everything else?
Wheels donβt collide with terrain. The vehiclewheeledsimulation deals with all of that
You could try to use NwkMovementComponent. This should gives your entity some simple interpolation in multiplayer.
this works great, my issue tho is that it seems like the rigidbody is simulated on other client when being controlled by someone else, so far I got rid of this behavior by setting sim state to inactive for everyone other than the player controlling my entity, is there a better way?
like lets say I control my entity but your game tries to simulate it anyway, it kinda looks like this is what was happening
You should do that, this is how vehicle is done currently
nice, accidentally did something the right way
scripty magic or regular SCR_destructionmultiphase ?
not even that, just the base one
which one?
it says base in the name of the component
? destruction base?
there may be something in your entity that cant be used with it?
hmm, yea probably, im trying to add it to ERA block from t14
How do I get my armor to actually have bullet collision. I've set the rigidbody component to firegeo and set the materials on the colliders but they still don't have fire collision and for some reason the colliders don't even animate with the visual geometry even though they're a UTM duplicate with the same rigging.
Here's an example of the lack of collision
I figured out the collision issue but I'm at a loss with the collider animation issue.
bro how
physics
how can you force clothing to stick to a body mine kinda just fly around π
#enfusion_animation would be best place, you probably didn't weight the vertices correctly
Is there anyway to apply force to an entity with VehicleWheeledSimulation? ApplyForceAt is ignored when called in EOnSimulate with that component
I used ApplyImpulse for my airplane """"flight model"""" successfully, but it was in EOnFrame or something like that, not on simulate
Gotcha so itd be frame dependent if done there. I wonder if multiplying by timeSlice would be sufficient to fix that
Id really like to use the wheels of wheeled sim with custom physics on top
Forces are cleared every time wheeled simulates, that's why you can't apply impulses to it. It will not stay like this forever (but it's also not my call π ).
yeah I basically have a wheeled simulation component and I apply the impulse in EOnFrame and it works
Ah okay, thanks for the info!
When should you use an impulse vs a force? Also whats the difference between applying an impulse and directly modifying the velocity vector?
Also is it possible to GET the inertia tensor? There is a method for setting it, but I can't find one for reading it
Right click on wheeled or helicopter simulation component "Compute local intertia"
What about for non vehicle/heli sim components
Just a prop for example
Not that I know of.
Should these work? I've tried to modify them but don't notice any change
Specifically iterations and ticks
I think all of the configs in this menu are loaded before any mods, so chaning the values wont work in any of them.
Whenever you change something physics related, restart workbench as a rule of thumb π
Ahhh, that worked! Thanks

Any idea what would kill an xbox and what I shouldn't set it to?
As with PC, many things π
You have to be specific
π I'll probably just experiment for now and then test on my xbox when it comes time.
Where do i tweak the center of mass? My TGB40 is very prone to tip over
Rigidbody component you can set COM manually
Could you do a printscreen?
You can create COM_Vehicle empty object in Blender do define center of mass
What could be the reason that im barely getting any steering? π
IΒ΄ve copied the ural prefab, so nothing really changed atm except the modelfile
So im thinking colliders?
like the car doesnt turn? did you assign wheels correctly?
Not sure if I have configured something incorrectly but my character has the ability to influence a physics objects thats super heavy and has a large inertia tensor in ways I wouldn't expect. Any ideas?
https://youtu.be/Pko5B30YZrA
Can you just ragdoll the player when they contact the vehicle while it is moving?
Yes, that could be a work around if this isn't an issue on my end
dude changed his name and I was wondering for two full minutes how he got access to Plato's A10 before release

π₯·
this one has cute profile pic so I will allow it
So when I import a model with bones, skinning, colliders, and all of that stuff showing up properly, how, and I add it to the βmesh objectβ of a prefab base like the APC prefab base, how do I keep it from hair falling through the map when I try to spawn it in GM???
Iβm doing something wrong in either blender or in the import settings. I canβt figure it out and Iβve tried a lot of stuff.
so eoncontact wont fire for when player capsule bonks an object right? since player capsule is not actually a physics object
any alternatives?
So basically when I import my mesh and object into the game and I label it with UTM and I try to set up the collision using the blender tools it doesnβt work when I add it to a prefab and try spawning it in GM. All it does is fall through the floor. I am very new to this so I donβt know how everything works exactly and Iβve been trying for the last few days to get it to work. I Iβve tried relabeling it and exporting skinning and setting up as simple Box collider and everything I can possibly think of to get it to actually work. When I set up a vehicle prefab and put my model as the mesh object it just clips through everything and falls through the map.
when you look at the .xob in the tools under the collider menu do they show up as having been added with no warning symbol?
Yes. I believe so
However they just donβt interact at all with anything when I try to slap it onto a vehicle prefab.
Iβm basically using one massive UTM collider to just see how to get them to work. Iβve also tried using just one big simple box as a collider and neither of them want to interact with anything.
Can you post screenshot from workbench showing thy collider?
What is parent prefab of your vehicle prefab?
these are the 2 different sets of colliders I have attempted to use. keep in mind I have messed around and tried setting up the layers differently and setting the materials in blender but that didnt work.
The parent prefab I have been using is the βWheeled_APC_Baseβ
Don't use trimesh for vehicle. Use UCX (convex mesh). Make sure each convex mesh is its own separate object. Double check mesh is convex before exporting. Will fail importing with errors. Use vehicle or vehicle complex.
Ok thanks for that. Iβll try that and see if it works.
your UBX_hull has wrong game mat. You could perhaps use UCX instead of UBX to see if it making a change
other than that, it could be also caused because of missing wheels configuration
Btw your most recent version of this removes the m1a1s turret
Donβt download it because Iβm only uploading it to test minor changes.
so when are we getting voronoi fracture?
https://pybullet.org/Bullet/phpBB3/viewtopic.php?t=7707
Looks like it has already been experimented with in bullet physics. Would definitely be cool to see in Enfusion.
How would I go about making a hanging lamp swing when hit by a bullet?
@blissful lotus attach it to whatever it's "hanging" from with a physics joint
What does the VehicleWheeledSimulation solver update rate get used for? I'm thinking its for increased accuracy on suspension components to reduce over-compensation between frames, but unsure.
Hello si I'm trying to get my firegeo to show up on the player but doesn't seem like it's working I've done this with helmets as you can see I child the firegro to spine5 and nothing happens it shows up in the xob format but not in the game any ideas
geometry is not animated in world editor viewport. Switch to play mode
also see this discussion #enfusion_model message
Sorry I fixed this but thanks for the help π
Is it possible to exert force onto a vehicle to push it into a direction upon an action ?
How about Physics.ApplyForce?
Oh yeah, that does seem like it. Just wanted to know if it's possible, I have an idea regarding it. Thanks. 
Physics.ApplyImpulseAt() is what you might need if you want your action to be directional e.g. from where the player is standing, in the direction of the car * how hard to push. A force is constant, like gravity, an impulse is a short yeet.
The short impulse would be better in that case. I just thought it would be interesting to try for tanks, to have them recoil with such a push when firing. 
oh you mean like when a vehicle fires its heavy turret guns?
I think bacon had a mod that did that but it did not work because it was before servers controlled vehicles
Yeah, I saw some videos of tanks in some mods and the firing was absolutely recoilless. π₯΄
Anyway, just wanted to know if it'd work since I had the idea for a while
Impulse is a force multipled by some amount of time. It is equivalent to adding a small amount of velocity if you divide the input impulse by mass of the object.
Impulse = integral of (mass*velocity)
Impulse also equals the change in momentum (or change in velocity if you divide by mass since momentum = mass*velocity)
technical description, a short yeet is also valid interpretation
ApplyForce is equally as valid.
vector myForce = β100 0 0β;
physics.ApplyForce(myForce);
physics.ApplyImpulse(myForce * timeSlice);
I believe these two statements are equivalent
I believe you want to use ApplyForce for relatively small forces and ApplyImpulse for relatively large forces
Here is an actual detail of impulse vs force for bullet physics
it did work, but only on the server, so you would have to rpc that the thing fired to the driver
it should work better now, as you can apply the physics serverside and it just works
You should still apply on both driver and server to not have any desync. Otherwise the driver will see his vehicle teleport on the client, if you apply it only on the server
right
Are cloth physics doable in Enfusion ?
@coral summit doubtful as the flags use proc animations iirc
Well sorry, didn't really answer your question. Doable as in can the engine support it? Probably so. Currently no though. But you could maybe get by with the shader the leaves use to emulate the wind blowing the fabric at least
Also never know what the fur stuff is going to include. It may include some stuff involving wind as well, making it another viable option, maybe.
It would make some stuff easier, but yeah I suppose it'd have to be animated in a software
Morphs would probably work great for that. If we had the walking animation in blender, we could morph depending on animation frame
I do have a general idea how it could be achieved to look like it's actual physics, but I'm not sure if it's even possible that way
Probably better for #enfusion_animation
I'm struggling with making GL-launched parachute flares. I have the 'magazine' for the UGL working fine. It has a TimerTriggerComponent set to SpawnPrefabEffect. That Prefab is my flare candle and dynamic light. Unfortunately I can't get the 'candle' to fall at increased drag or reduce gravity. My guess is it needs to be a submunition, but using it as a submunition effect makes it immediately shoot to the center of the earth. What gives?
I'm having a hard time trying to get two vehicles connected via a 6DOFJoint to behave appropriately with server authorative vehicles. I've tried playing with network tolerances but can't get much to work correctly. I've ensured that the owner of the two vehicles is the same player and the owner of the vehicles is simulating the joint locally. I've also tried simulating the joint on the authority in addition to the client with no luck. Any suggestions?
Should I abandon hope of this working for now? Should I switch back to client authorative vehicles for this application?
You have to run the adjustments on all clients
And server
I don't know the specifics, but I tested some things with SAV||server authorative vehicles|| and it works okay if I call it from the server and execute on all clients
I don't know about joints, but for modifying the vehicle parameters. That works okay
I was under the impression only the owner and authority are responsible for prediction. Proxies shouldn't have any say I believe. I'll give it a shot creating the joint on all proxies but I don't think it will do anything
Everything simulates the vehicle, but ONLY server simulation is syncronized
Server sends server data, clients use it to correct errors.
This is not true. Only owner and server simulates the physics of the vehicle. Remote proxies, so other players, just see a replay of the data.
Oh, I see, my bad, I was wrong
Good to know, this kind-of makes things easier for adding new features related to cars.
so my projectile has explosion impulse that pushes physics objects around but it doesnt throw characters around
or rather the warhead
so I wonder if this is even supposed to work or not
it seems like vehicles are pushed around with explosion impulse multiplier whereas ragdolls are pushed around with explosion damage values
Time to make script that ragdolls player if over a certain amount π
hi is it possible to walk on a floating object in water ?
Yes, if it's just floating in place, like the buoys outside harbours on Everon.
Nice and did you know about vehicle
Not natively supported by game. May or may not be possible to script this behavior in current version, idk.
Thanks that's what I thought
Floating vs driving. If floating yes. If driving no. As in we can't link characters to to the local space of vehicles and have them walk around. Though @stone parcel said it was possible but not very intuitive. I've done numerous tests and still haven't gotten it to work correctly.
Perfect π
I don't recall the outcome of my testing with that. I'll have to take a look when I get home.
Iirc that's possible atm. I don't recall if I had to do some hacky stuff or not though
maybe add a trigger to whatever the floating surface is and once it is triggered make a script that ensures the players position is in relation to the object, almost like a parenting transform thing, but idk if it is currently possible bc i dont script in enfusion and i think a few core libraries are un-editable/blocked form our view afaik
What you described is literally what I've done numerous tests trying to solve. Walking on a floating object is fine. We just can't "link" the characters to the local space of vehicles, thus keeping us from walking around on moving vehicles.
What happens when you apply velocity of the vehicle you're standing on every frame to your character?
Not sure. I tried everything I could think of to try to get AddChild to work with players to vehicles as to not need to run anything on tick. Last I tested animations break.
I'm worried doing it the silly way might be more realistic
It possibly could be. Lol
yeah that is a shame, maybe BI adds some more documentation on this sort of thing
EOnContact isnt very reliable for character collision, is there an alternative?
Yeah character and contact only triggers if you jump and it activates the rigidbody I think. Same with vehicles (but Idk if thats different now with the new vehicle system)
Maybe raycast in every direction but thats expensive
ouch dang that is indeed not efficient
collision trigger component does not get triggered in grenades
so I guess this makes it not possible to make hand grenades that explode on impact
What is the purpose of material overriden props in explosioneffect?
Any information on how to use it?
any idea of what's going on here?
like this visual glitch of the wheels
just happens when leaving the vehicle
you are playing vehicle getout animation of wrong vehicle? Check vehicle animation instance
I duplicated the M998 prefab and using almost everything for there
You would have to create new animations (including animation workspace) to disable those unwanted m998 animations
was kinda hoping EOnContact would've fired when a grenade collided with a player π¦
Probably have to use a collision trigger component
I'm having problems with GetPhysics().SetVelocity() and IEntity.SetYawPitchRoll().
It seems calling SetYawPitchRoll() messes with the velocity?
If i use GetPhysics().SetAngularVelocity() instead of SetYawPitchRoll() the speed set by SetVelocity() is consistend, with SetYawPitchRoll() the speed is reported as the same, but the actual distance is much less. My problem is that I cant manage to use SetAngularVelocity() to have the object face the desired direction π¦
Does anybody have some experience working with helicopter simultation
YPR is not related to physics. It's to set the entity transform instantly. If you want to make something spin by physics over time then you use angular velocity as you correctly observed.
is there a way to combine character locomotion on floating objects, like a yacht for instance? So character looks as if he is keeping his balance on a floating object?
try something like EOnFixedFrame(){ player.SetVelocity(player.GetVelocity() + yacht.GetVelocity()) }
that is dumb pseudocode but you get the idea
Arma has always sucked with this so good luck
I wonder if it's possible to add Euphoria style rangdoll physics to Arma Reforger. Like physics based hit reaction animations. 
Anyone knows if articulated steering is possible? Think how a Volvo A30 works:
Yes
Use a procedural animation for steering0 to rotate the articulation point
Do we know anything about BI plans for flight model? Hopefully much better than Arma3.
Not really. They implied there would be an advanced heli flight model, but that might only come with A4, it's not on the roadmap at least.
As for planes, they won't add any to Reforger, so we don't know either.
An advanced helo flight model would be good π
I bought a pirate ship from epic and i want to make it float / driverable for now. What I ask people in this chat or another
I'm new to modding and I need some direction
Follow this tutorial: https://community.bistudio.com/wiki/Arma_Reforger:Car_Creation A boat in Reforger is just a car without any wheels.
How is the bounding box offset on the buoyancy component meant to work? Yesterday (pre 1.1) I manually modified the way the points were calculated to add the bounding box offset vector to each point so the entire offset was applied, but now the Buoyancy component is c++ side and I can't do that anymore. I want all of the buoyancy points to be offset in the Y direction by a meter or two because the floats on my object are below the center of mass. But the 4 main buoyancy points are in a plane intersecting the COM.
In the picture you can see the offset is only applied to the two points in the middle of the object, not to all of the points
Also is there a way to make the buoyancy component on a child object work on the parent? (I would prefer this instead as the floats and landing gear are setup as slots) then I don't need separate water physics for the plane hull
Bounding box offset is already added for each point, you don't need to do that
The four points on the outside remain at the same Y level as the center of mass
the red ones stay at center of mass Y, and the blue ones move down based on the Y offset
Yes this is normal, because it only influence the AABB of the object, it doesn't influence offset of each point.
Offset the AABB will not change the side/forward height
Should I scale the Y instead then?
No, the only way would need to move the COM, or, create a feedback tracker ticket of a new property to offset every point
I do feel that bounding box offset is not really what was intended in the first place, and more like a point offset as you would want
I'll write a feedback tracker ticket. Hopefully in future they may be computed from geometry volumes instead for more detailed buoyancy
It is very simple buoyancy, if you need more complex one, just create your own. But this always come as a cost for sure.
Current bounding box is taken from mesh bounding box, to be as precise as possible
Thanks for insight!
hey, couple questions about colliders and rigid body physics. I have a prop with a collider and a rigid body applied. for some reason when placing vehicles on top of it, they glitch and interact weirdly. for example in a server helicopters will teleport all over the place when turned on and wheeled vehicles can't drive on it. is this a problem with my rigid body set up or is the collider mesh too complex? thanks in advance.
Have you chosen a Collision layer? If so, try another https://community.bistudio.com/wiki/Arma_Reforger:Collision_Layer
i have set as propfireview
I couldn't tell you which one, but I think maybe using a different layer preset will help you
it shouldn't mess with vehicles tho?
the props in game with the same layer don't act funky like that
You're suspicious your collider might be too complex, how complex is it?
a little, about 1500 polys, tho it is a big model. 333m to be exact
the model itself is very low poly for what it's worth
Sounds fine from my memory... so idk.
well I'll try Messi with the layer set up. maybe even create a new box collider instead of a trimesh as it is set up rn.
Try Rigid Body > Layer Presets > Vehicle
tried it out just now, didn't seem to change anything tbh. vehicles still desynch a lot. maybe it's the simulation state?
Check Response Index in RigidBody - if your prop is not destructible but has SmallDestructible Response Index, then vehicle might glitch with it
oh hey, I got it fixed it yesterday by changing the layer present to BuildingFire thanks.
hello, I wanted to know what scale size of a map is big enough and what size do the assets (houses, roads, trees etc) have to be or scaled to?
If I brought a model lets say a house for example that comes with collision and import it to my terrain would the house have physics? for example would i be able to wall into the house without phasing through the house? Or is there a steps that I have to do to make it a solid object
Follow the FBX import tutorial
Hello, I have an issue with my vehicle mod. Whenever I move it in Gamemaster and the wheel colliders touch the ground it does crazy spins and goes flying. Any idea what the issue could be?
Going to assume your colliders on your wheels are wrong layer preset. But that is a guess. If it is a modded vehicle, look at the xob file of a vanilla vehicle of the same/similar type, look at their skeleton, empties and collider setups. Easiest way to learn what you need on yours.
Hello, I imported a vehicle but I have a small collision issue; it seems to be penetrating the ground but can still collide with other vehicles. Do you have any idea where this might be coming from?
I fixed my layer presets for the colliders but it still goes flying
Any idea what else it could be?
Off the top of my head, not really. I am still going to assume it is collider based, but I am not sure how exactly. Does the prefab have mass etc setup for the mesh?
That fixed my issue!
Thanks alot
Hey Reyhard, apologies for the seemingly random tag, but i have a question regarding aircraft in relation to the modded physics.
Is it possible for BI to make a video documentation regarding adjusting/tweaking helicopter physics and configuration for modders to use?
Written documentation is preferred first, since videos takes more time to be produced. No idea when documentation for it will be released although task is somewhere in the backlog
Playing around with the ballistic resistance of cars, I trimmed it so 5.56x45 is not going through two car doors, however even no damage is given to a person behind it, the exit holes are visible. Is there an elegant way to turn it off earlier, otherwise I will have to increase the thickness.
An easy solution is to lower the penetration depth of the ammo.
anyone know where helicopter flight model physics code is located?
Not in script
Question to devs. Will you equip Enfusion with flight model physics for A4?
hope things like weapons eventually stop sometimes phasing through terrain
Your weapons?
I know most of the weapons on the Workshop don't have the correct colliders to prevent it.
I'll double check if the rpg7 I got is from the workshop
do you know which mod is this launcher from?
If you're the one that made it just make sure you have a collider with the Weapon layer preset. If it's still happening otherwise then it's a bug.
You didn't have to make a video showing that it was a default weapon lol
well, maybe someone on the engine team needs to see it, it would be interesting if I didn't know what colliders are after making guns for 2 years
it's not just weapons, vehicles as well, though they need higher velocity
seems like the likelihood increases with angular velocity
I didn't assume you made the weapon. I assumed whoever made the weapon didn't do it correctly. It would be interesting if you didn't know what a collider was after making weapons for 2 years but the same can be said about the person making their first weapon yesterday.
Probably so, it doesn't happen much(if any) that I've seen with AI/players getting killed and dropping them.
I used to be able to drive through buildings with a truck a while back
I've never experienced that. I have experienced gettingy barrel through a fence or wall and being able to shoot to the other side.
oh yeah I can phase into a sandbag wall and shoot out of it no problem under some circumstances
Always replicable?
sure, if some conditions are met I can phase into most stationary objects
funnily they kinda fixed it in A3 by making it so the Z of simulated entities can't go below 0.
0 being terrain level?
yeah, ATL (above terrain level)
But sometimes it ends up in an object that repeatedly (usually weapon holders) has its Z corrected falls back through terrain again and repeat π«
IMO they should make it the same here, does not make sense for Z of physics simulated entity to go below terrain.
I've never tried, what is beyond the terrain edge in Enfusion, infinite sea with the bed at the lowest Z of the terrain?
I made a ball with physics, its falling down, when its up in the air, but then itΒ΄s not getting stopped by the ground or anything else π . Wich layer preset should I use in Blender for my Collider? I tested some but doesnΒ΄t work so far :/
Okay, ist working now. I used two colliders, Vehicle and PropFireView. Both with a sphere as collider.
I also set the CCD Radius in the RigidBody up to 0.100
It does, because we have holes in terrain now π
Experimental, you can define tiles has holes
Damn why do I find this out while being like 3 countries away from my workstation
Bu there is still some issues with it, that needs to be addressed, not every feature in the game is handling it well
How? When this version came out I checked terrain tool and didn't see any button or UI for it.
Actually you are right, holes has been disabled for public for now π
I think 3rd time someone from BI accidently told me this was a feature π€£
NiiRoZz exposing feature, which is not yet in game 
(sry I had to haha)
#enfusion_ai message
for current maps developers, will this just be a feature updated for tiles or will this break the old tiles system that's in-place meaning having to re-do maps?
No will just add new feature for the tiles, it will not break anything
β€οΈ
https://medal.tv/games/arma-reforger/clips/i3uIgi2MBnjTY0Srs/d1337QW0a8hE?invite=cr-MSxreFcsMjQwNjYxNzMzLA is this something that we can hope a fix in next update ? (gettin yeeted far away at 10s)
6 Views. Watch Untitled and millions of other Arma Reforger videos on Medal, the #1 Game Clip Platform.
Never had that happen to me. Do you experience that commonly?
i wont say commonly but enough to get multiple videos of it
When I add a 3rd pouch to the grenadier vest, it is not moving with the vest itself. I tried adding a new slot and naming it "MagPouch3", but that way there was no movement at all and the pouch was standing on the ground, so I tried changing the Etool slot's prefab to pouch and adjusted its position. But this time it's not moving with the vest. And there is no pivot ID.
I'm trying to add a mat to the backpack but it doesn't have any physics.
To get it to animate you need it to 'stick' to a bone
If you're using BaseLoadoutClothComponent and adding a slot for it, you need to give it a Pivot ID that is the bone you want to stick it to (if I remember right backpacks are almost always on Spine5)
If the dropdown is empty and doesn't have any options, you can open the prefab in a text editor and add it by hand
then just reimport the prefab and it should move with the rest of the backpack -this will also mess up your offset (offset is based on the position of the bone), so you'll need to reposition it again
Man, you are a lifesaver! It worked, thank you so much...
Is it possible to make a flying vehicle that can fly like a flying saucer? Full 6DOF hovering?
Like basically a space ship with inertial dampening
Or would I have to do some weird thing where the game things it's a jeep or helicopter
You can simulate anything you like. The only time you need to make it a jeep or helicopter is when you want features they provide (like wheels). If you dont want wheels then just code the physics from scratch for how the flying saucer should behave. You can apply forces and moments to a rigidbody easily using the physics class of the entity
You could also write your own wheels if you wanted, its just a lot of work
Oooo that is pretty fantastic. Thanks! I'm going through the modding tutorials and everything seems really flexible.
Hi! I am not sure if I am asking this in the right section. Is there a simple way to fix how a person holds this bayonet? Its base is an M9 pistol, I am ok with hand position, but want to rotate the bayonet 90 degrees.
there might be few ways, one might be creating prefab with hierarchy and rotating child entity (bayonet) over there
and then assigning it to character
Thanks for your help. Could you perhaps explain it more detailed? I am not so experienced with such modifications.
create base entity, put bayonet as child of that entity, add hierarchy to bayonet, rotate it, save it as prefab
Thanks so much! I will try it.
Wonder if this was scrapped or if it will come at some point lol 0.o
Take a look at my 'melee_base' add-on on the workshop.
I use the same method as was suggested by others answering your question.
Thanks, I'll check it out.
I am using a water erase material inside my ship to eliminate water inside. It visually removes it but doesn't effect the physics below the waterline. Any way of doing this?
oh wow I forgot about this, I dont think so but maybe there's a way
Agreed we need rushing rapids
I'm able to turn up the speed of the water but no waves 
yeh you can alter waves in ocean sim material I think
ooooo
any idea if the new physic when people get out of helo can be altered ? players dying a lot in koth :/
Is it possible to decrease physics timestep for a specific entity? (increase frequency of simulation for that entity) I know there is an overall physics timestep that can be adjusted in the project settings, and in the vehicle wheeled sim there is a solver update rate that I assume solves the wheeled sim at a higher frequency than the normal physics loop, but that seems to be only for the wheeled sim
still have players going into funny physics stuff
that is indeed quite funny
I need some help with this, if I were to copy and paste the prefabs "text view" and edit the Pivot ID on a text editor / notepad thing, how would I reimport the new text? Seeing that the text view in game cannot be edited.
Do I need to save it as some type of file or something? I keep on trying the "import files" option but it says "Registration Complete 0 out of 0" and doesn't do anything
Nvm just found out I could go to my own file and just go through there and import it back in
Sick as hell
love you Loco
you might want to disable physics interaction between your slotted prefabs and the parent
Is it known if Reforger will have building destruction? And if so, will it have destruction similar to A3 (damage layers and finally entire mesh collapses), or more nuanced destruction (Battlefield 1, The Finals etc)?
it will have some basic destruction but its unknown if its merely a state switch like a3 or more advanced. i dont know of more information than shown in the roadmap up to know.
For AR something simple akin to A3 is expected.
ooo, would love to see a4 iterate on this and have bad company 2 type destruction :>
Trying to configure helicopter simulation for my mod and scratching my head. Basically I'm making a tandem rotor helicopter - thus the main rotor is located far forward of the center of gravity, and because of that it can't fly. Is the only realistic solution to move the rotor pivot to the center of mass? Not sure what adjusting tail rotor properties might accomplish.
Answer - yeah just pivot on the COM.
Not terribly impossible, but it would definitely have to be built into the engine from the ground up.
It must be more than doable nowadays. I know it was very resource heavy back in the day, but computers have quantum leaped since then.
I mean look at the particle effects you get with starfield. Entire planetary rings. All the dust is simulated.
Granted it's a single, single-player scene - but there's got to be a way to do a limited hack and/ version for multiplayer.
In regards to destruction, this may interest you somewhat. #reforger_experimental message
Thanks for that. Although it's pretty lame if it's only in the world editor. It means it's not dynamic. Just for those people that want to make tunnels/caves, which pretty much we already have.
no in-engine voronoi fracture? literally unusable
I tried it, but the algos I was porting need FP64 to work right. I did get convex hull working; could use to generate a mesh collider on import.
Where do you do this? im having a similar issue
in the slot
fixed it thanks
Next question for any 3dsmax users, has anyone managed to do custom attributes in 3dsMax? cant get my head round how to use this parameter editor
for my coliders
just do it in the import settings of the xob, dont waste time with these attributes
Does anyone know what is happening here and how I could fix it? I have a finished model with the same problem and I didn't want to fix it because I thought it was a unique problem to that vehicle because it was very high, however I see that the same thing is happening with this one and I would like it not to move when you leave it still
Hey guys, I'd like to be able to play around with heli sensitivity, this 1.2 update has made flying the mi8 boat more like flying a cargo ship and i want make it pre 1.1 haha.. Any idea where to start?
probably look at the components on the mi8 prefab
are you using vanilla animation graph for that
if so, all your bones have to be in the exact same spot as the vanilla vehicle, or they teleport when the animations start
only way around this is, if you want to keep your bones where they are, is to make your own vehicle door and steering animations
Oh I see, it makes sense, thanks for the info, but I fixed it by unchecking a box in the axes section
Do we have access to cloth physics like for like a trench coat or a poncho?
no
How do i make my own textures for vehicles and other things
oops wrong channel mb
Hy i am so sorry to send an other help message but i am stuck in every project 
This time is regarding the shell trajectory
i duplicate the t14 prefab and replace by my own canon but when i shoot on the same target my shell drop extremely fast and seems to spawn offest
Do you knwo how ca i tweak that ?
it can be speed coef in muzzle component, shell setting (speed, parent velocity), spawn point and muzzle end point in muzzle component of gun. But I see that trajectory is green, which means shell didnt drop much velocity - so thats probably thing in sight component, you need to put in pointinfo right bone
so the sight reticle will be centered and follow gun
thanks you i have tried and it not work i have redo a full prefab and now it's working ^^ i guess i would not have my answer but i am unstuck thanks you anyway
Hi, I'm tryng to make a push action for an object (just like the vehicles: SCR_PushVehicleAction) but it doesn't move. I think it's because Pyhisics.GetMas() returns 0 kg but i don't know why. Any ideas?
Physics physics = pOwnerEntity.GetPhysics();
float mas = physics.GetMass();
Print(mas);
If getmass returns 0, it means probably that your rigid body is configured as static in the prefab
I posted this in another channel but perhaps this channel is more appropriate:
Hello, new to this server and modding so apologize if I should post this somewhere else. I'm trying to create an artillery calculator for some modded mortars and I'm having trouble getting my calculations to line up to the ballistics as they occur in game. I've looked at the wiki page and I found that the ballistics calculations only account for gravity and air drag;
on https://community.bistudio.com/wiki/Arma_Reforger:Weapon_Creation/Prefab_Configuration#Creating_Ballistic_Table it says that the formula for air drag is "F = a/v^2 * 1/m, where F is the drag force, a is the (de)acceleration of bullet, v is the speed of the bullet, m is the mass of the bullet."
My understanding of the above is that F is the air drag parameter set on the shellmovecomponent of the bullet, so to simulate the path we need to solve for the deceleration at a given point, which gives us a = F * v^2 * m. This value is the magnitude of the drag vector, which has direction opposite velocity. We would then add this drag vector plus gravity to the velocity at a point to calculate it's overall deceleration.
Is the above correct? If so, I still seem to be getting much, much different results. The mortar in the mod that I'm trying to calculate this for, for instance, has (from what I was able to see in reforger tools) an initial muzzle velocity of 250m/s and the gun it's fired from has a initial velocity coefficient of 1.5, which results in a total initial velocity of 375 m/s. Using my above calculations, I get a max range of something like 8000 meters, which is waaayyy above the actual max range that it is in game, which is only like 1500 meters. I'm not sure why the discrepancy is so large
Here is the code for my calculations in case that is where the problem lies:
maybe you could make some use of the autogenerated AI ballistic tables?
Workbench can generate those for any shell and missile projectile
I've not worked with those before, Idk if I'm reading the table right but I don't think it's generating properly
as I read it, x is distance, y is aim height, z is time, but at the bottom of the chart is has like 3000m and an aim height of 2980, which even if the elevation was in miliradians would be like 170 degrees so idk about that
y is height below muzzle
or bullet drop in other words
in any case, you can check VBA script in spreadsheet that is shared
I think your calculation is missing proper time step
is the bullet drop in meters? So x = the horizontal distance the bullet had traveled since being fired horizontally, y is the vertical distance it dropped, and z is the time? If that's the case, the table says that at t = 2.689, the bullet has dropped 35.647 meters, which is faster than gravity
Ahhhhh yeah my bad In my head i was just doing .5 * g * t and not .5 * g * t^2
the projectile is has a mass of .25
if I reduce air drag to 0 and re-generate the ballistics tables, it seems to line up with gravity at the start, but the values for how much it drops seem to become smaller than gravity
For instance at 16.71 seconds, the table shows a drop of 1277.193 meters, when doing .5 * 9.81 * 16.71^2 = 1369 .6 meters
If air drag is 0, gravity should be the only force affecting its position, right? does the game use a lower value for the gravity constant?
Okay so I managed to make my simulations line up with the game. What seemed to be the problem was that when calculating the deceleration due to drag, I multipled by the mass, when I apparently needed to divide by mass. I'm unsure about this though, because the formula on the wiki says you need to multiply by it? Is it a typo on the wiki? @tight remnant
1/m is inverted mass
Did you just multiplied by mass? (*m) it's not the same thing as 1/n
What I mean is, The formula on the Page says F = a/v^2 * 1/m, but we must calculate a so we isolate it on one side. To do so, we must perform operations that cancel out the other terms on the right side. So we Multiply both sides by v^2 to get F * v^2 = a * 1/m. Then we multiply both side by m to get F * v^2 * m = a
a/v^2 * 1/m = a/(v^2 * m)
first of all, you want to calculate most likely velocity, not acceleration, since air drag is known
or perhaps I don't understand what you are trying to achieve?
The goal is to calculate the trajectory of a bullet or projectile launched with an initial velocity. At any moment in time, we know F, v, and m. In order to calculate where the object will go, we have to calculate the acceleration, which is determined by gravity and drag.
I've already solved the problem I was having. My solution works. All I'm saying is that I'm 99% sure the equation on that page should be F = a/v^2 * m, not F = a / v^2 * 1/m
How do you know velocity after 3s?
By starting with an initial velocity and calculating the accleration at incremental time steps. I'm sure there's a formula that you could create with some higher-level math techniques, but I just do it with a simulation
You need to calculate velocity (vector) and then apply it every time step
yes
Ok, but that is velocity, not acceleration
yes, but to calculate the velocity vector for the next time step, you need to calculate the acceleration, otherwise you don't know how the velocity changes over time
Calculus is useful here
Anyone point me in the right direction?
I have my bag being placed in the right position but I must be missing something with the physics or components... As you can see once it is built, the ladder seems to always point in this exact location. Even if i place the bag from a different position.
ignore the collision thing, was testing different things to make it work
Are you setting the rotation of the ladder entity? When it's placed via script it shares world coords iirc
Also a couple days late haha hope you figured it out
Nah negative haha, I havent scripted anything for this, I have just been using components.
Lol mine bag π
I'll try over here as well.
Trying to get the "FlareEffect_40mm_M661_Green.et" to fall. There a flaremovement.ct, and I've played with those values but just stays in the sky. Looked at the ammo how it was built.
What is the trick to effect gravity on an object?
I've tried placing a few things in WB and they either stay in the air, or get placed on the ground. I've tried to activate gravity and mess with some values in rigidbody and its the same. I haven't tried in game master to see if its any different. Are you placing this effect in the world or spawning it in?
Tried both, place it and spawn it in with a slot in SF
Like if I place a jeep in the air, it will spawn on the ground, if I place a soldier it will spawn dead on the ground. If I place a UGL grenade it will stay in the air too. I tried to activate physics/gravity on a jerrycan and it spawned on the ground.
I searched for a different entity to see if there was a physics one but nothing.
I think physics don't work from init, and projectiles need to be fired for things to kick in. A helicopter placed in the air will spawn on the ground burning..
Same old operation flashpoint physics\gravity. Newton never existed in the Armaverse
.
@elder pelican Thanks bud for the info and effort. It is weird. I think Newton would be pissed.
All these things that you're spawning in the air that have active physics, they're all falling to the ground. Jeep is spawning and falling to the ground, soldier is falling and hitting the ground and dying, helicopter is falling and getting destroyed.
Being a projectile, it falls through the map.
It will land on a vehicle though lol
@rustic harbor That might work because I am using it to mark an arsenal position. I'll look at that. Thanks.
You should be able to call method Launch on FlareMovementComponent, which should make it active and fall. I don't think there is a property to make it falling when it is spawned
do anyone know how to fix this? items lost rigid after unload from inventory
In the rigid component what are your settings
once its in the inventory it loses it, i dont think theres a βfixβ as all inv items dont have a collision
maybe theres a smart guy who knows a good solution but as far as my knowledge goes you need for example a script thats places down a prefab for you
Did you add the rigid body dynamically (From script)?
I talked to you about that issue over a year ago and you were supposed to help me get it sorted, lol. I tried whatever you told me to do at the time and it didn't work.

Time to revisit it then
I may or may not have sent you a test project. I don't recall.
This is expected, physics is disabled as soon as you put into your inventory. And never set it back when dropped.
You could just mod SCR_UnviersalInventoryStorageComponent::OnRemovedFromSlot method, and add a condition to check if it is your item, and if so, call InventoryItemComponent::EnablePhysics
Tried that.
It didn't work.
Did you try to add a ItemPhysicalAttributes in your item, and set the simulation state to collision ?
I'll test that when I get back home and let you know.
Tested. No worky.
I'm also testing with a custom InventoryItemComponent

have the same issue with deployable mortar. It is then difficult to find an action menu on an object to dismantle the mortar back to the crate
I just wonder why vanilla deployable radio doesn't have that issue
Maybe the position update should be triggered on the object somehow when it's dropped from inventory.
I think the radio has different model for these actions, but i might be wrong. I need to dissect radio thoroughly
Look at my ladder mod on the workshop
what was the trick to making it so my physics object doesnt go through other objects and terrain given sufficient speed? CCD doesnt help
I did this once by spawning a bigger geom to the Physics
The weapon magazines would fall through the ground otherwise.
There was an issue with collision with terrain, it has been solved recently in Enfusion, but it will probably come in two major update for Reforger
I can also phase through things like doors, fly into vehicles etc
Probably too small, or try to increase ccd radius
do you know how the GM floating camera allows radio to be used?
I want the same for my controllable that isnt a character
to still speak through the character
wrong channel for this tho probably
No I don't but pretty sure I saw complains that you can't hear direct voice around GM Camera. I know that VON is mostly using player controller
Yeah but I actually want radio
GM can hear and speak over radio
Can't change frequency but that's OK
Probably using some fake radio item. It seems in code it expect that there is a radio transceive
Use SetTransmitRadio on VoNComponent
Probably this is what GM uses
And SetCommMethod to set to speak over radio
interesting
It seems that SCR_VONController is doing most of the job communication to the VonComponent
I would check the ActionVONBroadcast in debug, and see if it goes correctly through all the method when you press the key to talk over the radio
ok thank you will give it a shot
I guess that GM part is not visible in script
It is, there is no GM part outside of script
Ah ok I couldnt find it I guess I'll look again later
Did you try to debug it, does it fail saomewhere specific ?
I dont know where to look in diag menu
No I said debug in script editor in ActionVONBroadcast when you try to speak over radio
Check class SCR_VONController
looks like when I take control of my entity something calls SCR_VoNController.RemoveEntry on everything and then when VONChannel is called it doesn't have the radio freq anymore under m_ActiveEntry
thats fine thanks it pointed me in the right direction, looks like I won't be able to easily make it work
So for this rocket I changed the rotation via transform + SetVelocity but I guess that doesn't combine very well. (It laggs weirdly)
#enf_showroom message
I guess I should use angular velocity to rotate it, right?
I used physics and it was smoother
that do be smooth 
I wanted to link you to the video with it being homing not guided but I can't find it
some of my shitty code is in that thread though
But you also SetAngles() not via angular velocity
But it is super smooth with angular velocity
I thought I used physics, maybe I confused it with something else, sorry about that
Interesting that it worked for you, mine glitches out with set angles 
Well it was like 25 years ago
fair
How exactly do you configure autohover to work, currently my drone sinks down when autohovering, is there anyway to fix this?
Shouldn't my entity be stable if I ApplyForceAt at 4 evenly offset points at the same time? It keeps spinning 
offset evenly from COM?
hmm I feel like that should work
unless your COM is changing somehow??? does it do that when you have slotted entities?
silly question but is the weight of supplies or inventory items simulated when carried in vehicles?
I don't think so, I'd been meaning to test if that lowers the suspension any. Might be able to open the diag menu and look at the suspension values loaded and unloaded?
I found an incredible bug whereby vehicle wheeled simulation on modded vehicles is broken ONLY on Linux dedicated server https://feedback.bistudio.com/T186285
I would like assistance in working around this until it can be fixed upstream
I ruled out it being the network by artificially inducing packet loss and higher ping (and also hosting the servers on different continents)
Is it possible to move simulated wheels on a vehicle with animation or something like that? I have a heli that has the option to put the gear up but the sim wheels always stay where they are 
No idea if this works but, what if you try and influence the tire size like it's done on damaged tires when they go flat ? I believe you can influence simulated wheel size in runtime. Now, if a value of 0 still collides with the environment at the center of the wheel, you could just make a very large wheel with it's center in the landing gear compartment, which would leave the center inside that compartment once tire size is at 0.
Probably sounds jank as hell, but hey. π€£
Is there an easy way to do helicopter landing gear that won't cause my helicopter to glitch on the ground due to suspension balance?
This problem seems to be inherent with vehicles with an even number of wheels due to lack of sway bar to connect systems - so what happens is the vehicle teeters constantly without any resolution for energy. It's literally a perpetual motion machine!
Guess I'm going this route with all of the issues this system has...
Well when I made the best vtol air vehicle in Reforger I just did my own thing
Whats up with the shrek bj emoji
Does anyone know what might cause a vehicle to always screech it's tires when the brakes are applied? The vehicle also vibrates lol
the wheels dont actually move for some reason so I dont even know if its possible, the way we did it is just fake it so the animation auto plays and extends whenever the helicopter gets near the ground
or else you could land a helicopter with retracted gears and it will just float because the simulated wheels dont actually move
i it possible to.. tilt simulation wheel sideways?
i know the answer is probably "do u brain damag" but i wanted to ask
nah it's set in stone in runtime
And no methods exposed to do anything
#winning
i am pretty sure simwheels do move no matter what, if sim is enabled
what is "glitch out" anyway? im trying to figure out sim thing, and ive seen my car jumping around. tha was due t ofew things, namely very short suspension travel distance, very hard suspension, and very low amount of clearance
you cant move the sim wheels on a helicopter, if you want to make a retracted landing gear
at least we couldnt get it working before
helicopters are different from cars
you saying heliwheels do NOT have suspension logic?
they do have suspension but you cant make the move any other way I believe
but if you figure it out let me know because we wanna do retractable landing gears manually instead of making them automaticallly deploy on distance
what if you parent suspension logic to an animated bone?
and move it upward via animation?
i never tested it so im asking
i know that you cannot change attachment points on runtime, but hwat about moving bone?
they are already assigned to the bone or else the suspension wouldnt work
My idea was trashing the suspension sim and building my own
Even the base game helicopter slides around
Iβll have to get a clip to demonstrate
Hereβs my helicopter though when friction is set high. Ironically setting friction low on one of the axises fixes it sliding on flat ground
looks like some collision clipping
My theory is that similar to how a table with 3 legs is more stable than one with 4 (3 point of contact made)
Not a collider issue because setting wheel friction low fixes it
i seen some guns sliding around because of bcollision issues
So basically the suspension is constantly trying to reach nominal
So when aft suspension springs off the ground the forward creates an equal force in the opposite direction. Iβm sure if I used 3 wheels it wouldnβt react as violently, also I think COM and model orientation plays a role
Since the suspension technically is pushing backward due to model having nose high attitude for import
in fbx all models should face Y+
Rotated on the longitudinal access about 4 degrees
And yes Iβm tracking that, it is
rotation of base mesh actually does NOT influence the flight afaik
some colliders, however, might
It does, rotation in prefab editor doesnβt have effect
There is no difference if my helicopter model is vertical if I want it to fly belly forward
Assuming itβs tail isnβt colliding with the ground
what if you move COM helper back Y- 3 meters?
if you using that helper as COM ingame, that is, and not creating generic one on import
Iβll see what that does but I havenβt had a large amount of time to mess with that, itβs set based on real life weight and balance so moving it isnβt ideal
Basically, I've tried every combination of wheel parameters to get suspension working on a 4 wheel helicopter and I have failed because of the limitations in the game. The closest I got to getting it right is what it is right now, which causes it to slide sideways very easily. I believe that the suspension does not lose energy like any system would in reality, thus it creates a perpetual feedback loop bouncing between the wheels, with wheel friction essentially being the only way to lose that energy (unfortunately a value close to 1 leads to a bounce)
you could set radius of wheels to 0, no?
there is api for that at least, wheel damage is using that
interesting, I didnt see that, ty sir
reyhard, is it possible to tilt simwheels?
dunno
its a "no"then
no, I don't know
by tilting i meant this
but not visual mesh, actual simulation wheel. probably that is not possible
since it will be way more complex calcualtion
We also never figured out how to solve this issue on our helicopters
How in depth is the physics engine in reforger, like is there a way to pull air density of an area to calculate lift
Or would I have to manually create my own values for calculating air density
Why does doing GetOwner().GetPhysics().ApplyForce("0 0 0") move my object, shouldn't this not apply any force
send full code setup that reproduces
override void EOnSimulate(IEntity owner, float timeSlice)
{
super.EOnSimulate(owner, timeSlice);
for (int i = 0; i < 4; i++)
{
vector force = vector.Up;
// Get the air density
float airDensity = m_aRotorControllers.Get(i).CalculateAirDensity();
// Gets the velocity of the air displaced by the rotor
float velocity = m_aRotorControllers.Get(i).CalculateInducedVelocity();
force = force * (m_aRotorControllers.Get(i).CalculateRotorForce());
if(m_aRotorControllers.Get(i).CalculateRotorForce() > 0)
Print(m_aRotorControllers.Get(i).CalculateRotorForce());
rb.ApplyForceAt(force, m_aRotorEntities.Get(i).GetOrigin());
}
}
the force vector is 0 0 0 and it sends my object flying whenever I try to apply the force
Just the rotor in worldspace as it's in the slotmanager of the drone
That is like sending no code at all π
Show what your custom methods do as well CalculateInducedVelocity, etc
float CalculateAirDensity()
{
vector alt = GetOwner().GetOrigin();
float temperature = SEA_LEVEL_TEMPERATURE - TEMPERATURE_LAPSE_RATE * alt[1];
float pressure = SEA_LEVEL_PRESSURE * Math.Pow((temperature / SEA_LEVEL_TEMPERATURE), (GRAVITY / (TEMPERATURE_LAPSE_RATE * AIR_GAS_CONSTANT)));
float airDensity = pressure / (AIR_GAS_CONSTANT * temperature);
return airDensity;
}
float CalculateLiftCoefficient()
{
float liftForce = droneRb.GetMass()/4 * GRAVITY;
float referenceArea = Math.PI * Math.Pow(m_fRotorRadius, 2);
float liftCoefficient = (2 * liftForce) / (CalculateAirDensity() * Math.Pow(CalculateInducedVelocity(), 2) * referenceArea);
return liftCoefficient;
}
float CalculateInducedVelocity()
{
float thrust = droneRb.GetMass()/4 * GRAVITY;
float rotorArea = Math.PI * Math.Pow(m_fRotorRadius, 2);
float inducedVelocity = Math.Sqrt(thrust / (2 * CalculateAirDensity() * rotorArea));
return inducedVelocity;
}
float CalculateRotorForce()
{
float rotorArea = Math.PI * Math.Pow(m_fRotorRadius, 2);
float angularVelocity = m_fRPM * (2 * Math.PI) / 60;
float airDensity = CalculateAirDensity();
float rotorForce = 0.5 * airDensity * rotorArea * CalculateLiftCoefficient() * Math.Pow(angularVelocity * m_fRotorRadius, 2);
return rotorForce;
}
Rotor force returns 0 because the rotor RPM is 0, so the force vector at 0 rpm is always 0 0 0, however apply a force vector of 0 0 0 sends the drone so far into the sky CalculateAirDensity() literally breaks from the altitude readings
So
if you manually do rb.ApplyForceAt("0 0 0", m_aRotorEntities.Get(i).GetOrigin());
Does that still cause it?
Yes
override void EOnSimulate(IEntity owner, float timeSlice)
{
super.EOnSimulate(owner, timeSlice);
for (int i = 0; i < 4; i++)
{
vector force = vector.Up;
// Get the air density
float airDensity = m_aRotorControllers.Get(i).CalculateAirDensity();
// Gets the velocity of the air displaced by the rotor
float velocity = m_aRotorControllers.Get(i).CalculateInducedVelocity();
force = force * (m_aRotorControllers.Get(i).CalculateRotorForce());
if(m_aRotorControllers.Get(i).CalculateRotorForce() > 0)
Print(m_aRotorControllers.Get(i).CalculateRotorForce());
rb.ApplyForceAt("0 0 0", m_aRotorEntities.Get(i).GetOrigin());
}
}
Yep, I increased the mass so you can see it in a not extreme example
It's only with ApplyForceAt()
ApplyForce works as expected
Pls test in exp

