Giter VIP home page Giter VIP logo

Comments (9)

garrynewman avatar garrynewman commented on August 11, 2024

Does the same occur if you do it in OnUpdate?

from sbox-issues.

SwagAccount avatar SwagAccount commented on August 11, 2024

Yes, ive tried all updates

from sbox-issues.

SwagAccount avatar SwagAccount commented on August 11, 2024

I've now changed my system so the arms attach to the camera and the ik is to move the hand to the gun, still the same effect.

from sbox-issues.

PolSpock avatar PolSpock commented on August 11, 2024

Hi,

Since this commit, i guess cause i didn't have this issue yesterday,
it looks like the GetAttachment position is now incorrect during the first tick :

image
image

I am currently investigating to find a scenario to reproduce the issue. I will edit this comment

Edit :

  1. Create GameObject parented to the head bone :
var goHat = new GameObject();
goHat.SetParent( bodySkinnedModelRenderer.GetBoneObject( bodySkinnedModelRenderer.Model.Bones.AllBones.Where( x => x.Name.Equals( "head" ) ).FirstOrDefault() ));
goHat.Components.Create<MyAttachment>();
  1. Create MyAttachment Component:
public class MyAttachment : Component
{
	[Property] public SkinnedModelRenderer SkinnedModelRenderer { get; set; }

	public SkinnedModelRenderer GetPlayermodel()
	{
		return GameObject.Components.GetInAncestors<SkinnedModelRenderer>();
	}

	protected override void OnStart()
	{
		base.OnStart();

		SkinnedModelRenderer ??= GameObject.Components.GetOrCreate<SkinnedModelRenderer>();

		var model = Cloud.Model( "darg/santahatprop" );
		SkinnedModelRenderer.Model = model;

		Transform.Position = GetPlayermodel().GetAttachment( "hat" ).Value.Position;
		Transform.Rotation = GetPlayermodel().GetAttachment( "hat" ).Value.Rotation;

	}

	protected override void OnUpdate()
	{
		base.OnUpdate();

		// TOGGLE COMMENT / UNCOMMENT
		//Transform.Position = GetPlayermodel().GetAttachment( "hat" ).Value.Position;
		//Transform.Rotation = GetPlayermodel().GetAttachment( "hat" ).Value.Rotation;
	}
}
  1. See bug OnStart:
2024-05-09.19-17-55.mp4

from sbox-issues.

garrynewman avatar garrynewman commented on August 11, 2024

I made a change that should fix the first frame being wrong position.

This won't fix the OP request though. This is a chicken and egg problem, and the only way I can see to fix it would be to allow you to set IK bones to offsets from GameTransforms.

from sbox-issues.

PolSpock avatar PolSpock commented on August 11, 2024

I made a change that should fix the first frame being wrong position.

This won't fix the OP request though. This is a chicken and egg problem, and the only way I can see to fix it would be to allow you to set IK bones to offsets from GameTransforms.

Nothing change for the sub issue (my build id : 14327656), i have created a issue in order to stop off topic for this issue : #5493

from sbox-issues.

SwagAccount avatar SwagAccount commented on August 11, 2024

Is there a reason that the skinned mesh renderer is updating after the camera, that is the only understandable thing that is happening. I can make any normal model renderer I want follow something by setting the position and it's perfect, but as soon as I change the model renderer to a skinned renderer it lags a frame behind.

from sbox-issues.

SwagAccount avatar SwagAccount commented on August 11, 2024

Ok strange thing happening. When I move the gun around it leaves a ghost of an arm that is perfectly connected to the gun, how I want, whilst the rest of the arm is stuck a frame behind. However, when I record it the ghosting doesn't appear in the recording. What on earth is happening.

from sbox-issues.

SwagAccount avatar SwagAccount commented on August 11, 2024

Ok, solved the issue by using SetIK and using the correct naming for parameters in anim graph.
https://cdn.halend.dev/retro/1105/sbox-dev_1xz8x0h9y0.png
if ( IkRightHand.IsValid() && IkRightHand.Active ) Target.SetIk( "hand_right", IkRightHand.Transform.World ); else Target.ClearIk( "hand_right" );

from sbox-issues.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.