unity – How to make Player consistently jump *to* a specific target rather than *towards* it?

I’m trying to make it so if my player hits “E” then they jump precisely to a specific target. The current code results in player jumping towards the target but not really making it there.

I’ve tried adjusting forceMultiply and ForceMode and adding an offset but I just can’t get a result that simply consistently launches the player’s rigidbody rb towards the anchorPoint position.

The code I have is:

private void Update()
{
    if (Input.GetKeyDown(KeyCode.E))
    {
        tryGrabbing = true;
    }
}

private void FixedUpdate()
{
    if (tryGrabbing)
    {
        rb.AddForce(anchorPoint.transform.position * forceMultiply, ForceMode.Impulse);
    }
}

Thank you for any help!!

physics – (Unity 3D) How to make Player consistently jump *to* a specific target rather than *towards* it?

I’m trying to make it so if my player hits “E” then they jump precisely to a specific target. The current code results in player jumping towards the target but not really making it there.

I’ve tried adjusting forceMultiply and ForceMode and adding an offset but I just can’t get a result that simply consistently launches the player’s rigidbody rb towards the anchorPoint position.

The code I have is:

private void Update()
{
    if (Input.GetKeyDown(KeyCode.E))
    {
        tryGrabbing = true;
    }
}

private void FixedUpdate()
{
    if (tryGrabbing)
    {
        rb.AddForce(anchorPoint.transform.position * forceMultiply, ForceMode.Impulse);
    }
}

Thank you for any help!!

8 – How to make subprocess & migration_lookup plugins behave consistently with single and multiple items arrays

I have a JSON that can hold single or multi values arrays and I can’t make subprocess + migration_lookup behave consistently. It correctly imports the nodes in all cases, but it adds the reference to the imported nodes (entity reference field) only when I have more than 1 item in my array.

my JSON can looks like this:

"behaviour": (
          {
            "name": "behaviour name",
            "description": "behaviour description"
          }
        )

or like this:

"behaviour": (
          {
            "name": "behaviour name",
            "description": "behaviour description"
          },
          {
            "name": "another behaviour name",
            "description": "another behaviour description"
          }
        )

the process part of my migration config:

  field_behaviour:
    plugin: sub_process
    source: behaviour_array
    process:
      target_id:
        plugin: migration_lookup
        migration: import_behaviours_json
        source: name

Downloaded files consistently disappearing from Internal Storage

I have a Moto G Power running Android 11.

I like to listen to audiobooks, so I routinely download files from OneDrive, using the OneDrive app, to folders in my internal storage.

When I open the “My Files” app, I can go directly to Internal Storage. When I open Internal Storage it actually takes me to the folder “/storage/emulated/0/” I cannot go up to a higher folder. So I created a folder there called “Audiobooks” I create subfolders for each audiobook and I use an app (Smart Audiobook Reader) to read them.

When I download files, I go to OneDrive, find the audiobook mp3 files I’m looking for, select “Download” and then save it in the appropriate Audiobook subfolder. Also sometimes I download jpg files that serve at the “book covers” in the app.

All of this works well. I download new files every few days, 2 or 3 at a time.

However, over time, files in these folders start disappearing seemingly at random. Only the mp3 files, and it happens without me even know it so I’m not sure when the files are disappearing. I vaguely think it might have something to do with how long ago the file was downloaded and whether or not I accessed it recently, but in general, files start disappearing within 2 weeks or them being downloaded. It’s only the MP3 files, and not the jpg files which leads me to believe a size issue too.

I’ve searched for solutions to this but no dice. This is what I’ve ruled out:

  • It’s not the audiobook app reader. I deleted it, installed a different one, and the problem continued to happen.

  • It’s not the Storage Manager under the Storage system settings. That feature is turned off.

  • Files aren’t hidden. I’ve selected to show hidden files in My files.

I feel like I’ve exhausted all of the usual suspects. So I’m wondering if anyone has any thoughts.

Why does handlebar not appear consistently in the native iOS UI design?

Handlebars usually appear at the top of Modal View:
iOS screenshot with a handlebar at the top

But in other system-level views, there is no handlebar, even if they functionally act like a Modal View. (For instance, this screen, where you can choose devices to send a photo by AirDrop, is definitely a modal task. But the view does not have a handlebar.)

Airdrop screen without handlebar

Does anyone know the reason for the difference behind these two designs?

shadowrun – Tracking Ammunition consistently in a Hell made of Bullets

Ranged weapons are a mainstay in many games. Most fantasy games come with arrows, bolts, and sling stones. Wild West comes with lead, powder, and percussion caps in the early times and metal cartridges in the later end of the timeframe. Modern games blow out ammunition in the dozens – even hundreds at times.

However, all those expendable items come at bookkeeping troubles: Is there still an arrow in the quiver, is the next chamber a bang or click, or can the MG put out another burst?

In computer games and playing traditional games online, this problem can be mitigated by having some kind of ammo counter on the screen for each weapon user. But table-play doesn’t offer that ease of use. Players have not unlimited floating numbers next to the head or self-updating character sheets.

At a table, the problem however is you need to update manually. In a fantasy game, my elven archer ended up needing a new sheet after the second or third session because I had erased a hole into the spot where ammo was counted. Putting the arrows on a separate sticky note made that page replaceable, but it was prone to be lost. Looking for the main copy of the inventory to make a new one was a noisy thing between the different pages of the sheet – amplified by the limited space on the table – barely more than the open pages of the core book was available to put down stuff for each player to handle the large map in the center.

But fantasy games like that usually don’t need to account for more than 20 or such arrows per player. So were absolutely needed, I had used an ammo-counter D20 for my quiver and used a holder-ring with some sticky in it to make sure it didn’t roll and wouldn’t be accidentally taken as a dice.

Tracking Ammo for the Bullet-Hell

The real problem however is when games combine many people shooting with shooting a lot and variable ammo usage. That is when shooting isn’t happening consistently. This gets us to Shadowrun: Firearms can let loose between one and 10 rounds per action of the runner, runners can have between one and four actions and could shoot akimbo. Oh, and each gun has different ammunition capacities…

In a scene that turned into a bullet hell, I was one of 5 runners. While we fought some rather resistant thing and I took a lot of drain, the other four spent several hundred bullets shooting full-auto. I am sure that at least two players lost count of what was left in their guns at some point: One recalculated twice if he had to reload using a calculator and slowing the game down, the other had a tiny post-it note upon which he just added strikes to see if he still owned any bullets and guesstimated if he had to reload or not.

How could players track the ammunition for their runners in a way that the amount of ammo left in the gun is easy to spot at a distance, fast to update, non-destructive to the character sheet, and not bound to a movable object (dice, marker) that might be accidentally shifted?

Why handlebar does not appear consistently in the native UI design of iOS?

Handlebar usually appears at the top of Modal View
enter image description here

But in other system-level views, there is no handlebar, even if they functionally act like Modal View. (For instance, the screen, where you can choose the devices you want sent photo to by AirDrop, is definitely a modal task. But the view does not have a handlebar)
enter image description here

Does anyone know the purpose of the difference behind these two designs?

design – If avoiding ../../../ in Node.js means putting my modules into /node_modules/, what pattern would let me consistently determine which files to move?

Title pretty much says it all. To avoid ../../../../../my-class.js file paths, the consensus is to move files to the /node_modules/ directory.

However only some of the files should go there obviously. But which ones? Sure I can say “this one seems important” and move it, but working with a team we all know there should be a clear, articulable, consistent strategy for how to structure files within the project.

How can we decide which modules are important enough to move to node_modules?

boundary conditions – Partial differential equation, The arguments should be ordered consistently, PDE parsing error, NDSolveValue

We consider the partial differential equation

(rho+nu) V(y,x) == Log(1 / (1 + y (x-y) (beta(psi – D(V(y,x),y)) – eps D(V(y,x),x)))) – eps y (x-y) D(V(y,x),x)

with the boundary condition

V(y,y) == 0

rho, nu, beta, psi, eps are strictly positive, known constants.

We want to solve for V(y,x) over the domain {(y,x) | y <= x, 0 <= y <= 1, 0.6 <= x <= 1}.

We pose the following problem to Mathematica:

par = {rho -> 0.00014, nu -> 0.00182, psi -> 227.1, beta -> 0.0966, eps -> 0.01};

set = {(rho + nu) V(y, x) == Log(1/(1 + y (x - y) (beta (psi - D(V(y, x), y)) - eps D(V(y, x), x)))) - eps y (x - y) D(V(y, x), x) , V(y, y) == 0} /. par;

Reg = ImplicitRegion((y <= x), {{y, 0, 1}, {x, 0.6, 1}});

NDSolve(set, V, {y, x} ∈ Reg)

We get the error message:

NDSolve: The arguments should be ordered consistently.

We don’t understand this message.

bbgodfrey explains that Mathematica might not be able to solve problems with such a boundary condition. Following bbgodfrey’s suggested approach we therefore try to solve the equation without the boundary condition, using NDSolveValue (because bbgodfrey uses DSolveValue). We pose the problem

NDSolveValue((rho + nu) V(y, x) == Log(1/(1 + y (x - y) (beta (psi - D(V(y, x), y)) - eps D(V(y, x), x)))) - eps y (x - y) D(V(y, x), x) /. par, V, {y, x} ∈ Reg)

This yields the error message

NDSolveValue::femper: PDE parsing error of {0.00196701 V+0.01 V$3966 (x-y) y-Log(1/(1+(Times(<<2>>)+Times(<<2>>)) (x+Times(<<2>>)) y))}. Inconsistent equation dimensions.

We are beginners as far as PDEs in Mathematica (and StackExchange) are concerned. Thank you for suggestions on how to proceed.