安徽省网站建设_网站建设公司_云服务器_seo优化
2025/12/26 19:00:21 网站建设 项目流程

ue 获取资产

import unreal actor_name = "BP_Bernice" # 获取 Editor Actor Utilities Subsystem subsystem = unreal.get_editor_subsystem(unreal.EditorActorSubsystem) # 获取所有关卡 Actor actors = subsystem.get_all_level_actors() for a in actors: print(a.get_name()) if a.get_name() == actor_name: comps = a.get_components_by_class(unreal.ActorComponent) for c in comps: print(c.get_name(), c.get_class())

让资产移动脚本:

import unreal # Actor 名称 actor_name = "BP_Bernice_C_UAID_24B2B9B96FE856AF02_1876048431" # 获取 Editor Actor Utilities Subsystem subsystem = unreal.get_editor_subsystem(unreal.EditorActorSubsystem) # 获取所有关卡 Actor actors = subsystem.get_all_level_actors() for a in actors: if a.get_name() == actor_name: print(f"Found actor: {a.get_name()}") # 打印组件信息 comps = a.get_components_by_class(unreal.ActorComponent) for c in comps: print(c.get_name(), c.get_class()) # --- 移动 Actor --- current_location = a.get_actor_location() print(f"Current location: {current_location}") # 偏移量,可以改成你想要的 offset = unreal.Vector(100, 0, 0) # 在X轴方向移动100单位 new_location = current_location + offset a.set_actor_location(new_location, sweep=False, teleport=False) print(f"New location: {a.get_actor_location()}")

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询