Hello I'm testing Neoaxis out and it looks like, this nice engine has bad API manual. Otherwise, Neoaxis is not a bad choice to learn......
I'm trying to make a script for basic 2D movement. I'm trying to code it out by myself. But a variable (for getting component) gets null with error message, here's the code below:
`using NeoAxis;
public void EventHandlerSimulationStep_SimulationStep(NeoAxis.Component obj)
{
var scene = obj.FindParent<Component_Scene>();
var ship = scene.GetComponent("Player");
var senderInput = ship.GetComponent<Component_InputProcessing>();
var physicsBody = ship.GetComponent<Component_RigidBody2D>();
var velocity = new Vector2(0, 0);
if(senderInput.IsKeyPressed(EKeys.W))
{
velocity.Y = -5;
}
if(senderInput.IsKeyPressed(EKeys.S))
{
velocity.Y = 5;
}
if(senderInput.IsKeyPressed(EKeys.A))
{
velocity.X = -5;
}
if(senderInput.IsKeyPressed(EKeys.D))
{
velocity.X = 5;
}
physicsBody.ApplyForce(velocity, Vector2.Zero);
}
public void InputProcessing_InputMessageEvent(NeoAxis.Component_InputProcessing sender, NeoAxis.UIControl playScreen, NeoAxis.Component_GameMode gameMode, NeoAxis.InputMessage message)
{
var ship = sender.Parent;
if(ship == null)
{
return;
}
}
`
It doesn't tells me which line the problem gets on. But at least it's saying one of the variable gets null.
The log:
[11:57:17.265] Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Submission#0.DynamicClass_681cc8c7_d9f7_4ef6_8289_546c492aaf66.EventHandlerSimulationStep_SimulationStep(Component obj)
at NeoAxis.Component.PerformSimulationStep() in C:_GitHub\NeoAxisEngine\Sources\Engine\NeoAxis.Core\Base\Component.cs:line 3243
at NeoAxis.Component.PerformSimulationStep() in C:_GitHub\NeoAxisEngine\Sources\Engine\NeoAxis.Core\Base\Component.cs:line 3229
at NeoAxis.Component.PerformSimulationStep() in C:_GitHub\NeoAxisEngine\Sources\Engine\NeoAxis.Core\Base\Component.cs:line 3229
at NeoAxis.Component.PerformSimulationStep() in C:_GitHub\NeoAxisEngine\Sources\Engine\NeoAxis.Core\Base\Component.cs:line 3229
at NeoAxis.Component.PerformSimulationStep() in C:_GitHub\NeoAxisEngine\Sources\Engine\NeoAxis.Core\Base\Component.cs:line 3229
at NeoAxis.ComponentHierarchyController.SimulateOneStep() in C:_GitHub\NeoAxisEngine\Sources\Engine\NeoAxis.Core\Base\ComponentHierarchyController.cs:line 193
at NeoAxis.ComponentHierarchyController.PerformSimulationSteps() in C:_GitHub\NeoAxisEngine\Sources\Engine\NeoAxis.Core\Base\ComponentHierarchyController.cs:line 238
at Project.PlayScreen.OnUpdate(Single delta)
at NeoAxis.Component.PerformUpdate(Single delta) in C:_GitHub\NeoAxisEngine\Sources\Engine\NeoAxis.Core\Base\Component.cs:line 3191
at NeoAxis.Component.PerformUpdate(Single delta) in C:_GitHub\NeoAxisEngine\Sources\Engine\NeoAxis.Core\Base\Component.cs:line 3178
at NeoAxis.Viewport.PerformTick(Single delta) in C:_GitHub\NeoAxisEngine\Sources\Engine\NeoAxis.Core\Renderer\Viewport.cs:line 1110
at Project.SimulationApp.EngineApp_Tick(Single delta)
at NeoAxis.EngineApp.PerformTick(Single delta) in C:_GitHub\NeoAxisEngine\Sources\Engine\NeoAxis.Core\EngineApp\EngineApp.cs:line 1826
at NeoAxis.EngineApp.DoTick() in C:_GitHub\NeoAxisEngine\Sources\Engine\NeoAxis.Core\EngineApp\EngineApp.cs:line 1932
at NeoAxis.EngineApp.CreatedWindow_ApplicationIdle(Boolean doTickOnly) in C:_GitHub\NeoAxisEngine\Sources\Engine\NeoAxis.Core\EngineApp\EngineApp.cs:line 1564
at NeoAxis.WindowsPlatformFunctionality.CreatedWindow_ApplicationWindowProc(IntPtr hWnd, UInt32 message, IntPtr wParam, IntPtr lParam) in C:_GitHub\NeoAxisEngine\Sources\Engine\NeoAxis.Core\EngineApp\Windows specific\WindowsPlatformFunctionality.cs:line 1433
at NeoAxis.WindowsPlatformFunctionality.DispatchMessage(MSG& lpMsg)
at NeoAxis.WindowsPlatformFunctionality.CreatedWindow_RunMessageLoop() in C:_GitHub\NeoAxisEngine\Sources\Engine\NeoAxis.Core\EngineApp\Windows specific\WindowsPlatformFunctionality.cs:line 1578
at NeoAxis.EngineApp.Run() in C:_GitHub\NeoAxisEngine\Sources\Engine\NeoAxis.Core\EngineApp\EngineApp.cs:line 2317
at NeoAxis.Player.Program.Main2() in C:_GitHub\NeoAxisEngine\Project\Sources\NeoAxis.Player\Program.cs:line 76
at NeoAxis.Player.Program.Main() in C:_GitHub\NeoAxisEngine\Project\Sources\NeoAxis.Player\Program.cs:line 31_
And the root:
I'm having problem on getting the path to Player (Rigidbody2D) object as you can see on the picture......
How do I get the path there ??? Or is there anything more I'm doing wrong?
Please tell me how to fix this thing.... I hope I'll get a fix from you guys.
Cheers,
Uotsci!