many guides used UserData.But only I don’t see the setUserData functions as in them. After understanding it, I realized that these manuals were outdated, and now there is no such function and userData should be set in a different way. After digging through the Box2d files for three days, I realized that I could not cope alone. I found out that it is possible to edit the b2fixtureDef structure to add my new data there. but I don’t understand how to do this correctly, because just adding a line to the structure of the program crashes
I would like to start by quoting some parts of the documentation. The first thing that catches my eye is the difference in the description of the
MovePosition methods of
Moves the kinematic
Rigidbodyand complies with the interpolation settings. When
Rigidbodyinterpolation is enabled,
Rigidbody.MovePositioncreates a smooth transition between frames. Unity moves a
FixedUpdatecall. The position occurs in world space. Teleporting a
Rigidbodyfrom one position to another uses
Moves the rigidbody to
Moves the rigidbody to the specified position by calculating the appropriate linear velocity required to move the rigidbody to that position during the next physics update. During the move, neither gravity or linear drag will affect the body. This causes the object to rapidly move from the existing position, through the world, to the specified position.
Because this feature allows a rigidbody to be moved rapidly to the specified position through the world, any colliders attached to the rigidbody will react as expected i.e. they will produce collisions and/or triggers. This also means that if the colliders produce a collision then it will affect the rigidbody movement and potentially stop it from reaching the specified position during the next physics update. If the rigidbody is kinematic then any collisions won’t affect the rigidbody itself and will only affect any other dynamic colliders.
2D rigidbodies have a fixed limit on how fast they can move therefore attempting to move large distances over short time-scales can result in the rigidbody not reaching the specified position during the next physics update. It is recommended that you use this for relatively small distance movements only.
It is important to understand that the actual position change will only occur during the next physics update therefore calling this method repeatedly without waiting for the next physics update will result in the last call being used. For this reason, it is recommended that it is called during the FixedUpdate callback.
Note: MovePosition is intended for use with kinematic rigidbodies.
The description of
Rigidbody2D.MovePosition seems to be more detailed but then the question arises whether the differences in the descriptions mutually applicable (to both types of rigidbodies)?
For example, the
Rigidbody.MovePosition description sounds like it moves only a kinematic rigidbody. It also explicitly states that
MovePosition complies with the interpolation settings and
position should be used for teleportation needs.
The last sentence looks like an exact answer to my question if all this were true. But at least this is not the case for
Rigidbody2D: my experiments have shown that both:
Rigidbody2D.position complies with interpolation settings.
The first part of this video demonstrates the movement of 2
Rigidbody2D kinematic objects with interpolation via
position. Then I turn off interpolation and play the same scene. Time is set to
0.01, so you can easily observe that interpolation works in the first part and does not in the second. Also in the first part you can notice that changing
Rigidbody2D.position with interpolation settings on really teleports the object (as documentation claims) but only in the first
FixedUpdate, then it is interpolated along with
So, my questions are (still the main one is the 3rd):
- Is the differences in the descriptions mutually applicable (to both types of rigidbodies)?
- Why does
Rigidbody2D.positioninterpolate the object after the first
FixedUpdatewhile it shouldn’t?
- What is the correct way to teleport the kinematic
Rigidbody2Dwith the interpolation settings on?
The only way I could come up with is turning interpolation off & on:
Rigidbody2D rb = player.GetComponent<Rigidbody2D>(); RigidbodyInterpolation2D interpolation = rb.interpolation; rb.interpolation = RigidbodyInterpolation2D.Interpolate; rb.position += (Vector2)shift; rb.interpolation = interpolation;
I am working on a project with the following data structure :
A user need to be able to perform personal filtering on a given project, and this filtering needs to be saved (for each user/project pair). For example, he can choose to filter based on attribute1, attribute 2.
For storing such user settings, I did use this schema:
and I can have for example a setting for attribute1 filtering, and in my user_setting table store the corresponding value.
My problem is that the user needs to be able to perform a manual filtering on the objects (i.e. filtering them with checkbox). That would result in choosing objectIDs among all the object IDs.
My first thought was to store them in setting_value as comma separated values, but I read that I should not denormalize (note that there can be a lot of objects, and a lot of projects).
Is it a good approach or should I rethink my user setting storage approach?
Using WooCommerce settings API to create some options on its settings page: https://docs.woocommerce.com/document/adding-a-section-to-a-settings-tab/
Everything works fine but unfortunately, I can’t seem to get checkboxes to be checked by default (before admin actually saves changes…aka on fresh install)
I know I can create the option in the DB on plugin install but I’m trying to just get the checkbox checked by default without creating options on plugin activation.
I’ve tried multiple options
'name' => __( 'Field Name', 'lpac' ), 'desc' => __( 'Field description', 'lpac' ), 'id' => 'field_id', 'type' => 'checkbox', 'default' => true, // doesn't work 'css' => 'min-width:300px;', );
I’ve tried setting the default to different values like ‘checked’ and ‘on’ but still, the checkbox is not checked by default
I want to manage user roles and permissions/capabilities through a plugin. Most plugins save their settings to the database. Since we’re running multiple environments with seperate databases, saving to the database is inconvenient. After every deploy we’d have to update the settings on the other environment.
What I’m looking for is a plugin which persists its settings to a file, much like ACF does with the
acf-json folder. This way I don’t have to remember to update the settings after every deploy. Is there any plugin which does this?
I’m aware there are plugins with manual backup/restore functionality. While this does alleviate the problem, it’s not the solution I’m looking for
Last night, I added a DNS record to my domain to allow Mailchimp to send emails as an official/authorized source.
It doesn’t seem to have totally worked, Mailchimp is sending emails but they are not being received – I believe this is because my SPF record is not properly authorizing Mailchimp’s servers to send on behalf of my domain.
I did a domain check at mxtoolbox and it’s showing "Multiple SPF Records Found":
Is it the ~all and -all that is causing an issue? It should be possible to have multiple TXT DNS records, right? Am I messing up the way I have added these TXT records?
I’d like to continue to be able to send email via Google/Gmail (this is working) but I also would like to authorize Mailchimp to send emails on behalf of my domain (hosted with GoDaddy)
Any suggestions for the setup I am trying to accomplish here? Thank you so much!
I got 127.0.1.1
with this command
ip -f inet -o addr show eth0 | cut -d' ' -f 7 | cut -d/ -f 1
I got Device "eth0" does not exist
So what do you suggest to fix it? or should I continue to use the ip 127.0.1.1?
I’ve added my own font sizes to the theme I’m working on, but the value "Default" persists in the dropdown. With the name scheme needed for this particular site I cannot just reformat "Default" to fit with my baseline typography. Can "Default" be removed somehow?
add_theme_support( 'editor-font-sizes', array( array( 'name' => esc_attr__( 'Book 16px', 'wav' ), 'size' => 16, 'slug' => 'book16px' ), array( 'name' => esc_attr__( 'Book 20px', 'wav' ), 'size' => 20, 'slug' => 'book20px' ), array( 'name' => esc_attr__( 'Book 24px', 'wav' ), 'size' => 24, 'slug' => 'book24px' ), array( 'name' => esc_attr__( 'Book 32px', 'wav' ), 'size' => 32, 'slug' => 'book32px' ), array( 'name' => esc_attr__( 'Book 36px', 'wav' ), 'size' => 36, 'slug' => 'book36px' ), array( 'name' => esc_attr__( 'Book 48px', 'wav' ), 'size' => 48, 'slug' => 'book48px' ), array( 'name' => esc_attr__( 'Book 64px', 'wav' ), 'size' => 64, 'slug' => 'book64px' ), array( 'name' => esc_attr__( 'Book 96px', 'wav' ), 'size' => 96, 'slug' => 'book96px' ), array( 'name' => esc_attr__( 'Book 144px', 'wav' ), 'size' => 144, 'slug' => 'book144px' ), ));
how do I copy an existing project with all the settings?
What are the official Wizards of the Coast / TSR D&D campaign settings?
The ones I know of off hand are the following, also it would be good to know what rule edition they initially started in and if they are no longer updated as of what edition:
- Forgotten Realms