multiplayer – A network object created with a rigid body moves at different speeds / angles / positions on clients / hosts – Unity Unet Mirror

I'm using the Mirror API with Unity 2019 to create a basic multiplayer game. The game is a simple style of ice hockey with players shaped like a cylinder and a cylinder washer. Network Manager creates players as PlayerPrefabs. The puck is a prefabricated registered record.

They all use Rigidbody for movements.

In the publisher (or in the single player game), it works fine, but once the client has joined the game and hit the puck, the puck moves faster on the client and then teleports (or perhaps elastics) where she is supposed to be. .

I've tried several settings on the network send intervals for each identity (that is, 0; 0.1; 0.001; 1/60; 1/64; 1/128; other). I've also changed the "Server tick rate" to 10; 20; 30; 60; 64; 128.

I'm pretty sure to have all the code in the right places and to call the server to create the spawns and so on. But below is all the code just in case. But as I said, I think the code is correct and that it is something in the settings that I have to change. (I've already tried Compression to None, Some, Lots and this seemed to be the best on None). Most networked values ​​are "short".

Code:

using System.Collections;
using System.Collections.Generic;
use UnityEngine;
using UnityEngine.UI;
using Mirror;

Public class MatchController: NetworkBehaviour
{
[HideInInspector] ushort public score_Team1 = 0;
[HideInInspector] ushort public score_Team2 = 0;
public text scoreText;
public GameObject puckPrefab;
[HideInInspector] public puck GameObject;

private void Start ()
{
UpdateScoreDisplay ();
if (puck == null)
{
SpawnNewPuck ();
}
}

void public UpdateScoreDisplay ()
{
scoreText.text = team_scale1 + ":" + team_scale2;
}

GoalScored public cancellation (short goalID, uint scorersNetId)
{
if (goal # == 1)
{
team_target1 + = 1;
}
if (goalID == 2)
{
Team_target2 + = 1;
}

UpdateScoreDisplay ();
}

public spid SpawnNewPuck ()
{
if (! isServer)
{
return;
}


puck = instantiate (puckPrefab);

NetworkServer.Spawn (puck);
}
}

and

[RequireComponent(typeof(Rigidbody))]



Public class HockeyInput_MP: NetworkBehaviour
{
Rigidbody rb;
public floating moveForce;
publicSensitivity float;
public Transform stickTransform;

private void Start ()
{


if (! isLocalPlayer)
{
return;
}

rb = GetComponent();
rb.freezeRotation = true;

Camera.main.GetComponent() .target = transform;
}

Private update void ()
{
if (! isLocalPlayer)
{
return;
}


DoMovement (Input.GetAxis ("Horizontal"), Input.GetAxis ("Vertical"));
DoStickMovement (Input.GetAxis ("RightStick_Horiz"), Input.GetAxis ("RightStick_Vert"));

}

Private Empty DoMovement (float h, float v)
{
Vector3 force = new Vector3 (h * moveForce, 0, v * moveForce);
rb.AddForce (force);
}

DoStickMovement (sail float rightStick_h, float rightStick_v)
{
Vector3 rot = stickTransform.localEulerAngles;
rot.y + = rightStick_h * rotSensitivity * Time.deltaTime;
stickTransform.localEulerAngles = rot;
}
}

The & # 39; Puck.cs & # 39; is currently just an empty class attached to the object the puck.

ALSO: My Rigidbody components are set to Interpolate.

Do you have any ideas for synchronizing the puck with the client and the host? Any help massively appreciated as always. Thank you so much!

trying to move a 2D object along the x-axis while it moves up and down on the y-axis

public class Mover: MonoBehaviour
{
// Start is called before the first update of the frame
public floating speed = 1.5f;
floating public yspeed = 0.5f;
empty Start ()
{

}

// The update is called once per image
void Update ()
{
MoveObstacle ();
}
cancel MoveObstacle ()
{
transform.Translate (-speed * Time.deltaTime, yspeed * Time.deltaTime, 0);

}

}

spritekit – Moves SKEmitterNode with the path it creates

In Swift in SpriteKit, I have a SKEmitterNode that I have set up to create traces as a result of the player. The target is set on myself, the scene, for these traces to be moved. I would like to be able to move EmitterNode to another position without the trace following it, but rather that it moves with it, so that the state of the trace that it creates either the same once it's moved to a new position. Is there a way to do that? I have tried experimenting with many things like the target node, but I have not yet found a way to solve this problem. I can edit to show the code if necessary. Thank you!

The cursor moves from its editing position to the end of the line in a safari

When I try to edit text in a text box in any position, the cursor moves to its final position.

5th dnd – If a spell is cast on a creature / moving object and lasts longer than the turn, and the creature / object moves, does the spell move it?

Spells only do what they say. The spell will tell you if it moves with an object or creature on which you centered it.

If the spell moves with the object or creature on which it was initially centered, it will say it.

In the description of the spell Darknessfor example, it is stated that

Magic darkness spreads from a point you choose in the range to fill a 15-foot radius sphere for the duration. Darkness is spreading in the corners. A creature with Darkvision can not see through this darkness and a non-magical light can not illuminate it. If the point you choose is on an object you are holding or on an object that you are not wearing, the darkness emanates from the object and moves with it. Completely covering the source of darkness with an opaque object, like a bowl or bar, blocks the darkness.

The accent is mine. The description of Darkness Clarify when the spell will move based on the point you have targeted, that is, this item is on an item you are holding or on an item that is not being worn or by another creature.

The spell Cloud of fogon the other hand, states:

A sphere of fog 20 feet radius appears within your reach until a wind of at least 10 miles to the hour hunting, or until the end of fate. The fog is centered on a point of your choice, spreading in the bends and obscuring strongly the area it fills.

This spell does not mention anything about the cloud moving with the object or creature on which you have centered the spell, so that it does not move with that object or that creature.

Should a button remain depressed if the user moves his mouse?

I am not sure if there is a winner here. A button must do "something". Open a link, modal, drag a panel, and so on. If the UI still indicates support when the mouse is not directly above it, it should do the same thing as if someone had just hovered over it and left it there. activate. Do not forget, for the Web anyway, that a lot of traffic comes from a mobile, in which float events do not exist anyway. (Minus exception for :focus)

unit – When the motion button is pressed, the shape of the character changes and always moves in the left direction

have a good day. When you press the motion button, the shape of the character changes and always moves in the left direction.

Why does this happen and what is the solution?

enter the description of the image here

enter the description of the image here

Press two buttons to move to the left and the shape changes.

using System.Collections;
using System.Collections.Generic;
use UnityEngine;

Public class PlayerKontrol: MonoBehaviour {

float public karakterHizi = 8f, maxSurat = 4f;
Private Rigidbody2D myRigidbody;
Private animator myAnimator;


private bool solaGit, sagaGit;

empty Awake () {
myRigidbody = GetComponent ();
myAnimator = GetComponent ();

}

void FixedUpdate () {
if (solaGit) {

SolaGit ();
}

if (sagaGit) {

SagaGit ();
}
}

AyarlaSolaGit (bool solaGit)
{
this.solaGit = solaGit;
this.sagaGit =! solaGit;
}

public void HareketiDurdur () {
solaGit = sagaGit = false;
myAnimator.SetBool ("run", false);
}

void SolaGit () {

float Xdurdur = 0f;
float surat = Mathf.Abs (myRigidbody.velocity.x);

if (surat <maxSurat)
Xdurdur = -karakterHizi;

Vector3 yon = transform.localScale;
yon.x = -0.3f;
transform.localScale = yon;

myAnimator.SetBool ("run", true);

myRigidbody.AddForce (new Vector2 (Xdurdur, 0));

}

void SagaGit () {

float Xdurdur = 0f;
float surat = Mathf.Abs (myRigidbody.velocity.x);

if (surat <maxSurat)
Xdurdur = -karakterHizi;

Vector3 yon = transform.localScale;
yon.x = 0.3f;
transform.localScale = yon;

myAnimator.SetBool ("run", true);

myRigidbody.AddForce (new Vector2 (Xdurdur, 0));

}

}

lightroom – Moves photos and converts them to NEF format after "adding" and not copying

I have just started using Lightroom, without any formal workflow, and I am adding my photos directly to the native raw format of the camera (NEF in my case) and from copies of my SD card created on my hard drive.

Now, I would like to apply a more "formal" approach, store them properly in meaningful files and also convert them to DNG.
Is it possible to do it automatically?

Otherwise, I guess the only option would be to import them again with the option "Copy as DNG". But in this case, I would have to apply again all the adjustments that I already made to the photos. Is there a way to do it?

Loop that moves variable locar? javaScript

I have this code:

var Enter the code hererosXest = 3;
var book = [

    //libro N1
    {
    title: "The Giver",
    stars: 4},



     //libro N2
    {
    title: "Hola",
    stars: 3
    }
];

// draw a shelf
filling (173, 117, 33);
rect (0, 120, width, 10);

// draw a book
filling (214, 255, 219);
rect (10, 20, 90, 100);
filling (0, 0, 0);
text (book[0].title, 15, 29, 70, 100);
for (var i = 0; i <book[0].stars; i ++) {
image (getImage ("cute / Star"), 13 + i * 20, 90, 20, 30);
}

The idea is that a loop runs through the local variable BooksXand and prints on the screen the books specified in the book book array, but honestly, I do not know how to do it. Does anyone give me a hand?