stride3d / stride3d/stride

Game Studio crash when copying a collider

Open
#2,823 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-Physics bug
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Release Type: GitHub

Version: master

Platform(s): Windows 10 19045.5965

Describe the bug
It seems copying and replacing colliders in Game Studio is impossible

To Reproduce
Steps to reproduce the behavior:
In Game Studio

  1. Add Entity to Scene
  2. Add model component and model to Entity
  3. Add BepuPhysics Character component to Entity
  4. Add two capsule colliders to Compound colliders list
  5. Configure first collider then copy Item0 and paste or replace to Item1

Expected behavior
Successful copying configured collider to another one

Log and callstacks
Exception: MissingMethodException: Cannot dynamically create an instance of type 'System.Collections.Generic.IList`1[Stride.BepuPhysics.Definitions.Colliders.ColliderBase]'. Reason: Cannot create an instance of an interface. at System.RuntimeType.ActivatorCache..ctor(RuntimeType rt) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) at Stride.Core.Assets.Editor.ViewModel.CopyPasteProcessors.AssetPropertyPasteProcessor.ConvertForCollection(CollectionDescriptor collectionDescriptor, Object& data) in D:\repos\stride\sources\editor\Stride.Core.Assets.Editor\ViewModel\CopyPasteProcessors\AssetPropertyPasteProcessor.cs:line 581 at Stride.Core.Assets.Editor.ViewModel.CopyPasteProcessors.AssetPropertyPasteProcessor.ProcessDeserializedData(AssetPropertyGraphContainer graphContainer, Object targetRootObject, Type targetMemberType, Object& data, Boolean isRootDataObjectReference, Nullable`1 sourceId, YamlAssetMetadata`1 overrides, YamlAssetPath basePath) in D:\repos\stride\sources\editor\Stride.Core.Assets.Editor\ViewModel\CopyPasteProcessors\AssetPropertyPasteProcessor.cs:line 104 at Stride.Core.Assets.Editor.Services.CopyPasteService.DeserializeCopiedData(String text, Object targetObject, Type targetMemberType) in D:\repos\stride\sources\editor\Stride.Core.Assets.Editor\Services\CopyPaste\CopyPasteService.cs:line 214 at Stride.Core.Assets.Editor.Quantum.NodePresenters.Commands.PastePropertyCommandBase.DoPaste(INodePresenter nodePresenter, Boolean replace) in D:\repos\stride\sources\editor\Stride.Core.Assets.Editor\Quantum\NodePresenters\Commands\PastePropertyCommandBase.cs:line 66 at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at Stride.GameStudio.Program.Main() in D:\repos\stride\sources\editor\Stride.GameStudio\Program.cs:line 148

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in sources/editor/Stride.Core.Assets.Editor/ViewModel/CopyPasteProcessors/AssetPropertyPasteProcessor.cs at ConvertForCollection, line 581, then review the stack trace through CopyPasteService.cs and PastePropertyCommandBase.cs. Reproduce the Game Studio steps with two capsule colliders; done means copying or replacing a configured collider succeeds without the MissingMethodException.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
game-dev, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.