I'm pretty new to programming with Python and am starting to learn how to use Ursina Game Engine...
Currently I'm running Python 3.9.4 through IDLE. I looked up a YouTube playlist that goes through different activities using Ursina. However I hit a snag with one of the videos. I keep receiving an Assertion Error even though I copied the code exactly as it is shown in the video.
Here is the complete Error I'm receiving:
= RESTART: C:/Users/Charbel/Desktop/Ursina Tutorials/smooth follow - flying dragon.py
package_folder: C:\Users\Charbel\AppData\Roaming\Python\Python39\site-packages\ursina
asset_folder: C:\Users\Charbel\Desktop\Ursina Tutorials
blender_paths:
{'2.7': WindowsPath('C:/Program Files/Blender Foundation/Blender/blender.exe'),
'2.8': WindowsPath('C:/Program Files/Blender Foundation/Blender 2.83/blender.exe'),
'default': WindowsPath('C:/Program Files/Blender Foundation/Blender 2.83/blender.exe')}
screen resolution: (1366, 768)
size; LVector2f(1092, 614)
render mode: default
development mode: True
application successfully started
Traceback (most recent call last):
File "C:\Users\Charbel\AppData\Roaming\Python\Python39\site-packages\direct\showbase\ShowBase.py", line 2153, in __igLoop
self.graphicsEngine.renderFrame()
AssertionError: !mat.is_nan() at line 322 of c:\buildslave\sdk-windows-amd64\build\panda\src\pgraph\transformState.cxx
Traceback (most recent call last):
File "C:/Users/Charbel/Desktop/Ursina Tutorials/smooth follow - flying dragon.py", line 22, in <module>
app.run()
File "C:\Users\Charbel\AppData\Roaming\Python\Python39\site-packages\ursina\main.py", line 238, in run
super().run()
File "C:\Users\Charbel\AppData\Roaming\Python\Python39\site-packages\direct\showbase\ShowBase.py", line 3325, in run
self.taskMgr.run()
File "C:\Users\Charbel\AppData\Roaming\Python\Python39\site-packages\direct\task\Task.py", line 546, in run
self.step()
File "C:\Users\Charbel\AppData\Roaming\Python\Python39\site-packages\direct\task\Task.py", line 500, in step
self.mgr.poll()
File "C:\Users\Charbel\AppData\Roaming\Python\Python39\site-packages\direct\showbase\ShowBase.py", line 2153, in __igLoop
self.graphicsEngine.renderFrame()
AssertionError: !mat.is_nan() at line 322 of c:\buildslave\sdk-windows-amd64\build\panda\src\pgraph\transformState.cxx
Here's a copy of my entire code:
from ursina import *
def update():
global dy
player.y += dy
if abs(player.y)>= 3:
dy = -dy
app = Ursina()
player = Entity(model='quad', scale=1, x = -4.5, texture = 'dragon_head.png')
e = [None]*50
e[0] = Entity(model='circle', scale = .2, color = color.green)
e[0].add_script(SmoothFollow(target = player, offset=(.3, 0, 0)))
dy =.08
for i in range(1,50):
e[i] = Entity(model='circle', scale = .2, color = color.green)
e[i].add_script(SmoothFollow(target = e[i-1], offset=(.2, 0, 0)))
app.run()
It appears that the error has something to do with the e[i-1] from my investigation. Has anyone else run into a similar issue or know if there's a bug in the Ursina language that causes this?
Thanks in advance
Charbel